public ActionResult Edit(int id)
        {
            DoctorFeeSetupModel model = new DoctorFeeSetupModel();

            model = pro.GetDoctorFeeList().Where(x => x.DoctorFeeID == id).FirstOrDefault();
            return(View(model));
        }
        public ActionResult Index()
        {
            DoctorFeeSetupModel model = new DoctorFeeSetupModel();

            model.DoctorFeeSetupModelList = pro.GetDoctorFeeList();
            return(View(model));
        }
Example #3
0
        public int Update(DoctorFeeSetupModel model)
        {
            int i = 0;

            using (EHMSEntities ent = new EHMSEntities())
            {
                var objtoeditDoctorFeeSetup = ent.SetupDoctorFees.Where(x => x.DoctorFeeID == model.DoctorFeeID).FirstOrDefault();
                AutoMapper.Mapper.Map(model, objtoeditDoctorFeeSetup);
                i = ent.SaveChanges();
            }
            return(i);
        }
Example #4
0
        public int Insert(DoctorFeeSetupModel model)
        {
            int i = 0;

            using (EHMSEntities ent = new EHMSEntities())
            {
                var objTosaveDoctorFee = AutoMapper.Mapper.Map <DoctorFeeSetupModel, SetupDoctorFee>(model);
                objTosaveDoctorFee.CreatedBy   = Utility.GetCurrentLoginUserId();
                objTosaveDoctorFee.CreatedDate = DateTime.Now;
                ent.SetupDoctorFees.Add(objTosaveDoctorFee);
                i = ent.SaveChanges();
            }
            return(i);
        }
 public ActionResult Create(DoctorFeeSetupModel model)
 {
     if (ModelState.IsValid)
     {
         int i = pro.Insert(model);
         if (i != 0)
         {
             TempData["success"] = HospitalManagementSystem.UtilityMessage.save;
             return(RedirectToAction("Index"));
         }
         else
         {
             TempData["success"] = HospitalManagementSystem.UtilityMessage.savefailed;
             return(RedirectToAction("Index"));
         }
     }
     return(View());
 }
 public ActionResult Edit(int id, DoctorFeeSetupModel model)
 {
     if (ModelState.IsValid)
     {
         //update
         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"));
         }
     }
     return(View(model));
 }
        public ActionResult Create()
        {
            DoctorFeeSetupModel model = new DoctorFeeSetupModel();

            return(View(model));
        }