Example #1
0
        public string ConfirmEditType(TypeViewModel vm)
        {
            TypeDomainModel t_dm        = new TypeDomainModel();
            var             mapper_accs = new MapperConfiguration(cfg => cfg.CreateMap <TypeViewModel, TypeDomainModel>()).CreateMapper();
            var             trans       = mapper_accs.Map <TypeViewModel, TypeDomainModel>(vm);
            string          response    = t.EditType(trans);

            return(response);
        }
Example #2
0
 public string EditType(TypeDomainModel DM)
 {
     if ((DM.Description == null) || (DM.Type == null))
     {
         return("One or more fields are empty");
     }
     else
     {
         trans_type t = tRep.SingleOrDefault(x => x.ID == DM.ID);
         t.Description = DM.Description;
         t.Type        = DM.Type;
         tRep.Update(t);
         return("");
     }
 }
Example #3
0
 public string AddType(TypeDomainModel DM)
 {
     if ((DM.Description == null) || (DM.Type == null))
     {
         return("One or more fields are empty");
     }
     else
     {
         trans_type t = new trans_type();
         t.Description = DM.Description;
         t.Type        = DM.Type;
         tRep.Insert(t);
         return("");
     }
 }