// // GET: /Consulation/ //public ActionResult Index() //{ // return View(); //} public ActionResult Create(int id) { ConsulationModel obj = new ConsulationModel(); obj.EmergencyMasterId = id; return(PartialView("_Create", obj)); }
public ActionResult Edit(int id) { ConsulationModel model = new ConsulationModel(); ConsulationProvider cp = new ConsulationProvider(); model = cp.GetListForConsulation().Where(x => x.Id == id).FirstOrDefault(); return(PartialView("_Edit", model)); }
public ActionResult Index(int id) { ConsulationModel model = new ConsulationModel(); ConsulationProvider cp = new ConsulationProvider(); model.ListConsulationModels = cp.GetSelectedData(id); model.EmergencyMasterId = id; return(PartialView("_Index", model)); }
public void Update(ConsulationModel model) { using (EHMSEntities ent = new EHMSEntities()) { var objToEdit = ent.Consulations.Where(x => x.Id == model.Id).FirstOrDefault(); AutoMapper.Mapper.Map(model, objToEdit); ent.Entry(objToEdit).State = System.Data.EntityState.Modified; ent.SaveChanges(); } }
public ActionResult Edit(ConsulationModel model) { ConsulationProvider cp = new ConsulationProvider(); if (ModelState.IsValid) { cp.Update(model); model.ListConsulationModels = cp.GetSelectedData((int)model.EmergencyMasterId); } return(PartialView("_Index", model)); }
public ActionResult Create(ConsulationModel model) { if (ModelState.IsValid) { ConsulationProvider cp = new ConsulationProvider(); cp.Insertvitals(model); int id = (int)model.EmergencyMasterId; model.ListConsulationModels = cp.GetSelectedData(id); } return(PartialView("_Index", model)); }
public int Insertvitals(ConsulationModel model) { try { int i = 0; using (EHMSEntities ent = new EHMSEntities()) { var objToSave = AutoMapper.Mapper.Map <ConsulationModel, Consulation>(model); ent.Consulations.Add(objToSave); i = ent.SaveChanges(); } return(i); } catch (Exception e) { return(0); } }