// // GET: /OperationTheatreDetails/Edit/5 public ActionResult Edit(int id) { OperationTheatreDetailsModel model = new OperationTheatreDetailsModel(); model = pro.GetObject(id); return(View(model)); }
public ActionResult Index() { OperationTheatreDetailsModel model = new OperationTheatreDetailsModel(); model.OperationTheatreDetalisList = pro.GetList(); return(View(model)); }
public ActionResult EidtTheatreDetails(int id) { OperationTheatreDetailsProvider pro = new OperationTheatreDetailsProvider(); OperationTheatreDetailsModel model = new OperationTheatreDetailsModel(); model = pro.GetObject(id); return(View(model)); }
public OperationTheatreDetailsModel GetObject(int id) { using (EHMSEntities ent = new EHMSEntities()) { var obj = ent.OperationTheatreDetails.Where(x => x.OperationTheatreDetailsID == id).FirstOrDefault(); OperationTheatreDetailsModel model = AutoMapper.Mapper.Map <OperationTheatreDetail, OperationTheatreDetailsModel>(obj); return(model); } }
public int Update(OperationTheatreDetailsModel model) { EHMSEntities ent = new EHMSEntities(); var objToEdit = ent.OperationTheatreDetails.Where(x => x.OperationTheatreDetailsID == model.OperationTheatreDetailsID).FirstOrDefault(); objToEdit.PersonAllocatedID = model.PersonAllocatedID; objToEdit.PersonAllocatedTypeID = model.PersonAllocatedTypeID; ent.Entry(objToEdit).State = System.Data.EntityState.Modified; ent.SaveChanges(); return(objToEdit.OperationTheatreMasterID); }
public void Insert(OperationTheatreDetailsModel model) { using (EHMSEntities ent = new EHMSEntities()) { var objToSave = AutoMapper.Mapper.Map <OperationTheatreDetailsModel, OperationTheatreDetail>(model); objToSave.PersonAllocatedTypeID = 1; //objToSave.ValidUpto = Convert.ToDateTime(model.date); ent.OperationTheatreDetails.Add(objToSave); ent.SaveChanges(); } }
public ActionResult Create(OperationTheatreDetailsModel model) { try { // TODO: Add insert logic here return(View()); } catch { return(View()); } }
public ActionResult Edit(int id, OperationTheatreDetailsModel model) { try { // TODO: Add update logic here if (ModelState.IsValid) { pro.Update(model); return(RedirectToAction("Index")); } else { return(View(model)); } } catch { return(View()); } }
public ActionResult EidtTheatreDetails(int id, OperationTheatreDetailsModel model) { OperationTheatreDetailsProvider pro1 = new OperationTheatreDetailsProvider(); try { if (ModelState.IsValid) { int i = pro1.Update(model); //List<OperationTheatreDetailsModel> TheatreDetailsList = new List<OperationTheatreDetailsModel>(); //TheatreDetailsList = pro.GetTheatreDetailsList(model.OperationTheatreMasterID); TempData["message"] = "Successfully Updated!"; return(RedirectToAction("Details/" + i)); } else { return(View(model)); } } catch { return(View()); } }