public ActionResult MachineServiceCmprsrEdit(CmprsrServiceNew cmprsrServiceEdit) { if (ModelState.IsValid) { Models.MachineService service = new Models.MachineService(); service.Id = cmprsrServiceEdit.Id; service.Staff.Id = Convert.ToInt32(cmprsrServiceEdit.InchargeName); service.MaterialCost = cmprsrServiceEdit.MaterialCost; service.LabourCost = cmprsrServiceEdit.LabourCost; service.StartDate = cmprsrServiceEdit.StartDate; service.EndDate = cmprsrServiceEdit.EndDate; service.JobDone = cmprsrServiceEdit.JobDone; service.Machine.Id = cmprsrServiceEdit.CmprsrId; service.RegNo = cmprsrServiceEdit.RegNo; service.Type = "Compressor"; Database.Session.SaveOrUpdate(service); ViewBag.ActionMethod = "Edit"; return(PartialView("SuccessCmprsr")); } return(PartialView()); }
public ActionResult MachineServiceCar(CarServiceNew carServiceNew) { if (ModelState.IsValid) { var machine = Database.Session.Query <Models.Machine>().Where(x => x.CarId == carServiceNew.CarId).FirstOrDefault <Models.Machine>(); Models.MachineService service = new Models.MachineService(); service.Machine = machine; service.Staff.Id = Convert.ToInt32(carServiceNew.InchargeName); service.MaterialCost = carServiceNew.MaterialCost; service.LabourCost = carServiceNew.LabourCost; service.StartDate = carServiceNew.StartDate; service.EndDate = carServiceNew.EndDate; service.JobDone = carServiceNew.JobDone; service.RegNo = carServiceNew.RegNo; service.Type = "Car"; Database.Session.Save(service); ViewBag.ActionMethod = "New"; return(PartialView("SuccessCar")); } return(PartialView()); }
public ActionResult MachineServiceRigEdit(RigServiceNew rigServiceEdit) { if (ModelState.IsValid) { Models.MachineService service = new Models.MachineService(); service.Id = rigServiceEdit.Id; service.Staff.Id = Convert.ToInt32(rigServiceEdit.InchargeName); service.MaterialCost = rigServiceEdit.MaterialCost; service.LabourCost = rigServiceEdit.LabourCost; service.StartDate = rigServiceEdit.StartDate; service.EndDate = rigServiceEdit.EndDate; service.JobDone = rigServiceEdit.JobDone; service.Machine.Id = rigServiceEdit.RigId; service.RegNo = rigServiceEdit.RegNo; service.Type = "Rig"; Database.Session.SaveOrUpdate(service); ViewBag.ActionMethod = "Edit"; return(PartialView("SuccessRig")); } return(PartialView()); }