public ActionResult Create(SetupOtherTestModel model) { EHMSEntities ent = new EHMSEntities(); var data = ent.SetupOtherTests.Where(m => m.OtherTestName == model.OtherTestName).Select(m => m.SetupOtherTestId).ToList(); if (data.Count() > 0) { TempData["success"] = "Test Name Already Exist !"; return(View(model)); } else { int i = pro.insert(model); if (i != 0) { TempData["success"] = HospitalManagementSystem.UtilityMessage.save; } else { TempData["success"] = HospitalManagementSystem.UtilityMessage.savefailed; } } return(RedirectToAction("Index")); }
public ActionResult SearchIndex(SetupOtherTestModel model) { string TestName = string.Empty; string DepartmentId = string.Empty; if (!string.IsNullOrEmpty(model.OtherTestName)) { TestName = model.OtherTestName.ToLower(); model.SetupOtherTestModelList = pro.Getlist().Where(x => x.OtherTestName.ToLower().StartsWith(TestName)).ToList(); } return(View("Index", model)); }
public ActionResult Index(string DptName) { int DeptIdInt = 0; SetupOtherTestModel model = new SetupOtherTestModel(); model.SetupOtherTestModelList = pro.Getlist(); if (!String.IsNullOrEmpty(DptName)) { DeptIdInt = Convert.ToInt32(DptName); model.SetupOtherTestModelList = pro.GetlistByDepartmentName(DeptIdInt); } model.TestTypeID = DeptIdInt; return(View(model)); }
public int Update(SetupOtherTestModel model) { int i = 0; EHMSEntities ent = new EHMSEntities(); var objToEdit = ent.SetupOtherTests.Where(x => x.SetupOtherTestId == model.SetupOtherTestId).FirstOrDefault(); AutoMapper.Mapper.Map(model, objToEdit); decimal TaxTotal = Convert.ToDecimal((model.PayableGrandTotal * 5) / 100); objToEdit.PayableTaxTotal = TaxTotal; objToEdit.Status = true; ent.Entry(objToEdit).State = System.Data.EntityState.Modified; i = ent.SaveChanges(); return(i); }
public ActionResult Edit(SetupOtherTestModel model) { int i = pro.Update(model); if (i != 0) { TempData["success"] = HospitalManagementSystem.UtilityMessage.edit; return(RedirectToAction("Index")); } else { TempData["success"] = HospitalManagementSystem.UtilityMessage.editfailed; return(RedirectToAction("Index")); } }
public int insert(SetupOtherTestModel model) { EHMSEntities ent = new EHMSEntities(); int i = 0; var objToSave = AutoMapper.Mapper.Map <SetupOtherTestModel, SetupOtherTest>(model); objToSave.CreatedBy = HospitalManagementSystem.Utility.GetCurrentLoginUserId(); objToSave.Status = true; objToSave.CreatedDate = DateTime.Now; decimal TaxTotal = Convert.ToDecimal((model.PayableGrandTotal * 5) / 100); objToSave.PayableTaxTotal = TaxTotal; ent.SetupOtherTests.Add(objToSave); i = ent.SaveChanges(); return(i); }
public ActionResult Edit(int id) { model = pro.Getlist().Where(x => x.SetupOtherTestId == id).FirstOrDefault(); return(View(model)); }