Пример #1
0
        //
        // GET: /Consulation/

        //public ActionResult Index()
        //{
        //    return View();
        //}
        public ActionResult Create(int id)
        {
            ConsulationModel obj = new ConsulationModel();

            obj.EmergencyMasterId = id;

            return(PartialView("_Create", obj));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
 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();
     }
 }
Пример #5
0
        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));
        }
Пример #6
0
        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));
        }
Пример #7
0
 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);
     }
 }