Ejemplo n.º 1
0
        public static CitizenPlanVersions MapToCitizenPlanVersionModel(this CitizenPlanViewModel pgMinisty)
        {
            CitizenPlanVersions viewModel = new CitizenPlanVersions()
            {
                Id                = pgMinisty.CitizenPlanId ?? 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,
                CitizenPlanId     = pgMinisty.CitizenPlanId,
                ArDescription     = pgMinisty.ArDescription,
                EnDescription     = pgMinisty.EnDescription,
                ArTitle           = pgMinisty.ArTitle,
                EnTitle           = pgMinisty.EnTitle,
                Link              = pgMinisty.Link,
                Image             = pgMinisty.Image,
                EnImage           = pgMinisty.EnImage,
                ArMainTitle       = pgMinisty.ArMainTitle,
                EnMainTitle       = pgMinisty.EnMainTitle
            };

            return(viewModel);
        }
 public bool Update(CitizenPlanVersions model)
 {
     try
     {
         _db.CitizenPlanVersions.Update(model);
         _db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
 public void Add(CitizenPlanVersions model)
 {
     _db.CitizenPlanVersions.Add(model);
     _db.SaveChanges();
 }