public ActionResult PerformCreateService(string code, int hours, int minutes, decimal cost, bool isActive) { VM_Service service = new VM_Service { ServiceCode = code, TimeCost = new VM_Time(hours, minutes), Cost = cost, IsInUse = isActive }; var id = this._iServiceServices.CreateNewServiceReturnId(ConvertVM.VMService_To_Service(service)); return(Json(id)); }
internal static SPMS.ObjectModel.Entities.Service VMService_To_Service(VM_Service vM_Service) { logger.EnterMethod(); try { return(new SPMS.ObjectModel.Entities.Service() { Id = vM_Service.Id, Cost = vM_Service.Cost, ServiceCode = vM_Service.ServiceCode.Trim(), TimeCost = vM_Service.TimeCost.Hour * 60 + vM_Service.TimeCost.minute, IsInUse = vM_Service.IsInUse }); } catch (Exception e) { logger.Error("Error: [" + e.Message + "]"); return(null); } finally { logger.LeaveMethod(); } }
internal static void VM_ServiceAddName(ref VM_Service vM_Service, string name) { vM_Service.Name = name; }