#Outlook - 19.1

This commit is contained in:
Alexander Mikhailov
2019-05-06 09:45:48 +03:00
parent 2e45b5d38f
commit c9fc96eaac
182 changed files with 32549 additions and 3938 deletions

View File

@@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Drawing;
using DevExpress.Utils;
using DevExpress.XtraEditors.Controls;
using System.Runtime.Serialization;
using System.Collections.Generic;
namespace DevExpress.DevAV {
public class Picture : DatabaseObject {
public byte[] Data { get; set; }
public virtual ICollection<Employee> Employees { get; set; }
public virtual ICollection<CustomerEmployee> CustomerEmployees { get; set; }
public virtual ICollection<Product> Products { get; set; }
public virtual ICollection<ProductImage> ProductImages { get; set; }
}
static class PictureExtension {
public const string DefaultPic = DefaultUserPic;
public const string DefaultUserPic = "DevExpress.DevAV.Resources.Unknown-user.png";
internal static Image CreateImage(this Picture picture, string defaultImage = null) {
if(picture == null) {
if(string.IsNullOrEmpty(defaultImage))
defaultImage = DefaultPic;
return ResourceImageHelper.CreateImageFromResourcesEx(defaultImage, typeof(Picture).Assembly);
}
else return ByteImageConverter.FromByteArray(picture.Data);
}
internal static Picture FromImage(Image image) {
return (image == null) ? null : new Picture()
{
Data = ByteImageConverter.ToByteArray(image, image.RawFormat)
};
}
}
}