Exemplo n.º 1
0
 public DBProcessResult ModifyVehicleGroup(EMVehicleGroupViewModel view)
 {
     DBProcessResult result = new DBProcessResult();
     try
     {
         EMVehicleGroup entity = ConvertHelper.ConvertObj<EMVehicleGroupViewModel, EMVehicleGroup>(view);
         EMVehicleGroupService service = new EMVehicleGroupService();
         service.Update(entity);
         result.IsSuccess = true;
     }
     catch (Exception ex)
     {
         result.IsSuccess = false;
         result.Message = ex.Message;
     }
     return result;
 }
Exemplo n.º 2
0
 public DBProcessResult AddVehicleGroup(EMVehicleGroupViewModel view)
 {
     IdentityNoService noService = new IdentityNoService();
     DBProcessResult result = new DBProcessResult();
     try
     {
         EMVehicleGroup entity = ConvertHelper.ConvertObj<EMVehicleGroupViewModel, EMVehicleGroup>(view);
         entity.GroupID = noService.GetVehicleGroupID();
         entity.Remark = " ";
         EMVehicleGroupService service = new EMVehicleGroupService();
         service.Insert(entity);
         view.GroupID = entity.GroupID;
         result.IsSuccess = true;
     }
     catch (Exception ex)
     {
         result.IsSuccess = false;
         result.Message = ex.Message;
     }
     return result;
 }