示例#1
0
 public static IDataImage ToImage(this  Image.Image input)
 {
     return(new DataImage
     {
         Id = input.Id,
         Caption = input.Caption,
         PublicKey = input.Caption,
         CreatedDate = input.CreatedDate,
         CreatedBy = input.CreatedBy,
         Url = input.Url
     });
 }
示例#2
0
        public async Task UpdateSellerInfo(
            long SellerId,
            string Name,
            string Address,
            string PhoneNumber,
            string Description,
            long?CoverImage,
            long?Logo)
        {
            Seller seller = await SellerRepository.GetAsync(SellerId);

            if (CoverImage.HasValue)
            {
                Image.Image oldImage = seller.SellerCover?.Image;
                if (oldImage == null || oldImage?.Id != CoverImage.Value)
                {
                    SellerCover cover = new SellerCover
                    {
                        ImageId = CoverImage.Value
                    };

                    seller.SellerCover = cover;
                }
            }

            if (Logo.HasValue)
            {
                Image.Image oldImage = seller.SellerCover?.Image;
                if (oldImage == null || oldImage.Id != Logo.Value)
                {
                    SellerLogo logo = new SellerLogo
                    {
                        ImageId = Logo.Value
                    };
                    seller.SellerLogo = logo;
                }
            }

            seller.Name        = Name;
            seller.Address     = Address;
            seller.PhoneNumber = PhoneNumber;
            seller.Description = Description;

            await SellerRepository.UpdateAsync(seller);

            await CurrentUnitOfWork.SaveChangesAsync();
        }
示例#3
0
        public async Task EditBrand(long BrandId, string BrandName, long?BrandImage, string Description)
        {
            Brand brand = await GetBrand(BrandId);

            if (BrandImage.HasValue)
            {
                Image.Image oldImage = brand.BrandImage.Image;
                if (oldImage.Id != BrandImage)
                {
                    BrandImage brandImage = new BrandImage
                    {
                        ImageId = BrandImage.Value
                    };
                    brand.BrandImage = brandImage;
                }
            }
            brand.Description = Description;
            brand.Name        = BrandName;
            await Repository.UpdateAsync(brand);

            await CurrentUnitOfWork.SaveChangesAsync();
        }
示例#4
0
 public HomeController(Image.Image image)
 {
     _image = image;
 }
示例#5
0
 public Series()
 {
     TitleImage = new Image.Image();
     Projects   = new List <Project>();
 }
示例#6
0
 public Project()
 {
     TitleImage = new Image.Image();
     Images     = new List <Image.Image>();
 }
示例#7
0
 public ImagesController(Image.Image image)
 {
     _image = image;
 }
示例#8
0
 public Profile()
 {
     Image = new Image.Image();
 }