Beispiel #1
0
        public ActionResult Details(int id)
        {
            SetupManpowerModel model = new SetupManpowerModel();

            model = pro.GetlistOfMainpower().Where(x => x.ManpowerId == id).FirstOrDefault();
            return(View(model));
        }
Beispiel #2
0
        public ActionResult Edit(int id)
        {
            EHMSEntities       ent   = new EHMSEntities();
            SetupManpowerModel model = new SetupManpowerModel();

            model = pro.GetlistOfMainpower().Where(x => x.ManpowerId == id).FirstOrDefault();
            return(View(model));
        }
Beispiel #3
0
        public ActionResult Index()
        {
            SetupManpowerModel model = new SetupManpowerModel();

            model.lstofSetupManpowerModel = pro.GetlistOfMainpower();

            return(View(model));
        }
Beispiel #4
0
        public int Insert(SetupManpowerModel model)
        {
            int i         = 0;
            var objToSave = AutoMapper.Mapper.Map <SetupManpowerModel, SetupManpower>(model);

            ent.SetupManpowers.Add(objToSave);
            i = ent.SaveChanges();
            return(i);
        }
Beispiel #5
0
        public int Update(SetupManpowerModel model)
        {
            int          i         = 0;
            EHMSEntities ent       = new EHMSEntities();
            var          objToEdit = ent.SetupManpowers.Where(x => x.ManpowerId == model.ManpowerId).FirstOrDefault();

            AutoMapper.Mapper.Map(model, objToEdit);
            // ent.Entry(objToEdit).State = System.Data.EntityState.Modified;
            ent.Entry(objToEdit).State = System.Data.EntityState.Modified;
            i = ent.SaveChanges();

            return(i);
        }
Beispiel #6
0
        public ActionResult Edit(SetupManpowerModel model)
        {
            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"));
            }
        }
Beispiel #7
0
        public ActionResult Create(SetupManpowerModel model)
        {
            SetupManpowerModel obj = new SetupManpowerModel();

            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"));
            }
        }