Esempio n. 1
0
        public ActionResult Edit(SetupMemberDependentModel model)
        {
            SetupMemberDependentProvider pro = new SetupMemberDependentProvider();
            SetupMemberDependentModel    obj = new SetupMemberDependentModel();

            int i = pro.UpdateRelations(model);

            if (i != 0)
            {
                TempData["success"] = UtilityMessage.edit;
                EHMSEntities ent = new EHMSEntities();

                obj.refSetUpMemberShipModel           = new SetUpMemberShipModel();
                obj.refSetUpMemberShipModel.FirstName = model.refSetUpMemberShipModel.FirstName;

                obj.lstOfSetupMemberDependentModel = new List <SetupMemberDependentModel>(AutoMapper.Mapper.Map <IEnumerable <SetupMemberDependent>, IEnumerable <SetupMemberDependentModel> >(ent.SetupMemberDependents.Where(x => x.SetupMemberID == model.SetupMemberID).ToList()));
                return(View("Relations", obj));
            }
            else
            {
                TempData["success"] = UtilityMessage.editfailed;
                EHMSEntities ent = new EHMSEntities();

                obj.refSetUpMemberShipModel           = new SetUpMemberShipModel();
                obj.refSetUpMemberShipModel.FirstName = model.refSetUpMemberShipModel.FirstName;

                model.lstOfSetupMemberDependentModel = new List <SetupMemberDependentModel>(AutoMapper.Mapper.Map <IEnumerable <SetupMemberDependent>, IEnumerable <SetupMemberDependentModel> >(ent.SetupMemberDependents.Where(x => x.SetupMemberID == model.SetupMemberID).ToList()));
                return(View("Relations", model));
            }
        }
Esempio n. 2
0
        public ActionResult Delete(int id, int SetupMemId, string Name)
        {
            SetupMemberDependentModel model = new SetupMemberDependentModel();

            model.refSetUpMemberShipModel = new SetUpMemberShipModel();
            SetupMemberDependentProvider pro = new SetupMemberDependentProvider();
            EHMSEntities ent = new EHMSEntities();
            int          i   = pro.Delete(id);

            if (i != 0)
            {
                TempData["success"] = UtilityMessage.delete;

                model.lstOfSetupMemberDependentModel        = new List <SetupMemberDependentModel>(AutoMapper.Mapper.Map <IEnumerable <SetupMemberDependent>, IEnumerable <SetupMemberDependentModel> >(ent.SetupMemberDependents.Where(x => x.SetupMemberID == SetupMemId).ToList()));
                model.refSetUpMemberShipModel.SetupMemberID = SetupMemId;
                model.refSetUpMemberShipModel.FirstName     = Name;
            }
            else
            {
                TempData["success"] = UtilityMessage.deletefailed;

                model.lstOfSetupMemberDependentModel        = new List <SetupMemberDependentModel>(AutoMapper.Mapper.Map <IEnumerable <SetupMemberDependent>, IEnumerable <SetupMemberDependentModel> >(ent.SetupMemberDependents.Where(x => x.SetupMemberID == SetupMemId).ToList()));
                model.refSetUpMemberShipModel.SetupMemberID = SetupMemId;
                model.refSetUpMemberShipModel.FirstName     = Name;
            }



            return(View("Relations", model));
        }
Esempio n. 3
0
        public ActionResult Edit(int id, string Name)
        {
            SetupMemberDependentProvider pro = new SetupMemberDependentProvider();

            SetupMemberDependentModel model = new SetupMemberDependentModel();



            //model.refSetUpMemberShipModel.FirstName = Name.ToString();


            model = pro.GetRelationWithId(id);
            model.refSetUpMemberShipModel = new SetUpMemberShipModel();

            model.refSetUpMemberShipModel.FirstName = Name.ToString();

            return(PartialView(model));
        }