public ActionResult servicesRegister(servicesofferedtbl serviceRegModel) { servicesofferedtbl servicetblvals = new servicesofferedtbl(); using (dbPatientBillingEntities5 dbServiceModel = new dbPatientBillingEntities5()) { if (dbServiceModel.servicesofferedtbls.Any(x => x.Service_Description == serviceRegModel.Service_Description)) { ViewBag.Duplicatemsg = "Service already exist."; return(View("servicesRegister", serviceRegModel)); } else { servicetblvals.Service_Description = serviceRegModel.Service_Description; servicetblvals.Cost_Of_Service = serviceRegModel.Cost_Of_Service; } dbServiceModel.servicesofferedtbls.Add(servicetblvals); dbServiceModel.SaveChanges(); } ModelState.Clear(); ViewBag.SuccessMessage = "Service Added Sucessfully."; return(View("servicesRegister", serviceRegModel)); #endregion }
public ActionResult ServicesList() { dbPatientBillingEntities5 dbServices = new dbPatientBillingEntities5(); var servicesTbl = dbServices.servicesofferedtbls.ToList(); //ViewBag.operatortList = OperatorTbl; return(View(servicesTbl)); }
public ActionResult servicesRegister() { dbPatientBillingEntities5 dbServiceModel = new dbPatientBillingEntities5(); servicesofferedtbl serviceRegModel = new servicesofferedtbl(); var viewName = dbServiceModel.servicesofferedtbls.ToList(); ViewBag.viewName = viewName; return(View(serviceRegModel)); }
public ActionResult BillGenerate() { dbPatientBillingEntities5 ds = new dbPatientBillingEntities5(); var items = ds.servicesofferedtbls.ToList(); if (items != null) { ViewBag.data = items; } return(View()); }