Exemple #1
0
        public ActionResult Index()
        {
            SetUpHospitalFeeDiscountModel model = new SetUpHospitalFeeDiscountModel();

            model.SetUpHospitalFeeDiscountModelList = HospitalFeeDiscountProvider.GetList();
            return(View(model));
        }
Exemple #2
0
        public ActionResult Edit(int id)
        {
            SetUpHospitalFeeDiscountModel model = new SetUpHospitalFeeDiscountModel();

            model = HospitalFeeDiscountProvider.GetList().Where(x => x.FeeDiscountId == id).FirstOrDefault();

            return(View(model));
        }
Exemple #3
0
 public void Details(int id)
 {
     using (EHMSEntities ent = new EHMSEntities())
     {
         var config = new MapperConfiguration(cfg => {
             cfg.CreateMap <SetupHospitalFeeDiscount, SetUpHospitalFeeDiscountModel>();
         });
         //AutoMapper.Mapper.CreateMap<SetupHospitalFeeDiscount, SetUpHospitalFeeDiscountModel>();
         var Details = ent.SetupHospitalFeeDiscounts.Where(x => x.FeeDiscountId == id).FirstOrDefault();
         SetUpHospitalFeeDiscountModel det = AutoMapper.Mapper.Map <SetupHospitalFeeDiscount, SetUpHospitalFeeDiscountModel>(Details);
     }
 }
Exemple #4
0
        public int Update(SetUpHospitalFeeDiscountModel model)
        {
            using (EHMSEntities ent = new EHMSEntities())
            {
                var objToEdit = ent.SetupHospitalFeeDiscounts.Where(x => x.FeeDiscountId == model.FeeDiscountId).FirstOrDefault();

                AutoMapper.Mapper.Map(model, objToEdit);

                ent.Entry(objToEdit).State = System.Data.EntityState.Modified;
                ent.SaveChanges();
            }
            return(1);
        }
Exemple #5
0
 public int Insert(SetUpHospitalFeeDiscountModel model)
 {
     using (EHMSEntities ent = new EHMSEntities())
     {
         var objToSave = AutoMapper.Mapper.Map <SetUpHospitalFeeDiscountModel, SetupHospitalFeeDiscount>(model);
         objToSave.CreatedBy   = "1";
         objToSave.CreatedDate = DateTime.Now;
         objToSave.Status      = true;
         ent.SetupHospitalFeeDiscounts.Add(objToSave);
         ent.SaveChanges();
     }
     return(1);
 }
Exemple #6
0
 public ActionResult Edit(int id, SetUpHospitalFeeDiscountModel model)
 {
     if (ModelState.IsValid)
     {
         int i = HospitalFeeDiscountProvider.Update(model);
         if (i == 1)
         {
             TempData["success"] = "Record Updated Successfully !";
         }
         else
         {
             TempData["success"] = "Record Updation Failed !";
         }
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Exemple #7
0
        public ActionResult Create()
        {
            SetUpHospitalFeeDiscountModel model = new SetUpHospitalFeeDiscountModel();

            return(View(model));
        }