Пример #1
0
        public static HomePagePhotoVersions MapToPhotoVersionModel(this HP_PhotoViewModel pgMinisty)
        {
            HomePagePhotoVersions viewModel = new HomePagePhotoVersions()
            {
                Id = pgMinisty.PhotoId ?? pgMinisty.Id,
                IsActive = pgMinisty.IsActive,
                IsDeleted = pgMinisty.IsDeleted,
                VersionStatusEnum = pgMinisty.VersionStatusEnum,
                ChangeActionEnum = pgMinisty.ChangeActionEnum,
                CreationDate = pgMinisty.CreationDate,
                ModificationDate = pgMinisty.ModificationDate,
                ModifiedById = pgMinisty.ModifiedById,
                ApprovalDate = pgMinisty.ApprovalDate,
                ApprovedById = pgMinisty.ApprovedById,
                CreatedById = pgMinisty.CreatedById,
                ArDescription = pgMinisty.ArDescription,
                ArTitle = pgMinisty.ArTitle,
                EnDescription = pgMinisty.EnDescription,
                EnTitle = pgMinisty.EnTitle,
                ImageUrl = pgMinisty.ImageUrl,
                HomePagePhotoId = pgMinisty.PhotoId,
                Url = pgMinisty.Url
            };

            return viewModel;
        }
Пример #2
0
 public bool Update(HomePagePhotoVersions model)
 {
     try
     {
         _db.HomePagePhotoVersions.Update(model);
         _db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Пример #3
0
 public void Add(HomePagePhotoVersions model)
 {
     _db.HomePagePhotoVersions.Add(model);
     _db.SaveChanges();
 }