Beispiel #1
0
        //
        // GET: /SetupMemberDependent/

        public ActionResult Index()
        {
            SetUpMemberShipProvider pro = new SetUpMemberShipProvider();

            SetUpMemberShipModel obj = new SetUpMemberShipModel();

            obj.lstOfsetSetUpMemberShipModel = pro.Getlist();
            foreach (var item in obj.lstOfsetSetUpMemberShipModel)
            {
                item.FirstName = item.FirstName + " " + item.MiddleName + " " + item.LastName;
            }



            foreach (var item in obj.lstOfsetSetUpMemberShipModel)
            {
                using (EHMSEntities ent = new EHMSEntities())
                {
                    item.cnt = (from x in ent.SetupMemberDependents
                                where x.SetupMemberID == item.SetupMemberID
                                select x).ToList().Count();

                    item.cnt = item.MaximumDependent - item.cnt;
                }
            }


            return(View(obj));
        }
Beispiel #2
0
        public ActionResult Create()
        {
            SetUpMemberShipModel model = new SetUpMemberShipModel();

            model.CountryID = 153;

            return(View(model));
        }
        public SetUpMemberShipModel GetMemberShipWithId(int id)
        {
            using (EHMSEntities ent = new EHMSEntities())
            {
                var obj = ent.SetupMemberShips.Where(x => x.SetupMemberID == id).FirstOrDefault();
                SetUpMemberShipModel model = AutoMapper.Mapper.Map <SetupMemberShip, SetUpMemberShipModel>(obj);

                return(model);
            }
        }
Beispiel #4
0
        public ActionResult Details(int id)
        {
            SetUpMemberShipModel model = new SetUpMemberShipModel();

            SetUpMemberShipProvider obj = new SetUpMemberShipProvider();

            model = obj.GetDetailsOfMembershipWithId(id);

            return(View(model));
        }
        public SetUpMemberShipModel GetDetailsOfMembershipWithId(int id)
        {
            SetUpMemberShipModel model = new SetUpMemberShipModel();

            using (EHMSEntities ent = new EHMSEntities())
            {
                var obj = ent.SetupMemberShips.Where(x => x.SetupMemberID == id).SingleOrDefault();

                model = AutoMapper.Mapper.Map <SetupMemberShip, SetUpMemberShipModel>(obj);
            }



            return(model);
        }
Beispiel #6
0
        //public ActionResult Index(int? page)
        //{
        //    SetUpMemberShipModel obj = new SetUpMemberShipModel();

        //    SetUpMemberShipProvider pro = new SetUpMemberShipProvider();
        //    obj.lstOfsetSetUpMemberShipModel = pro.Getlist();
        //    var pageNumber = page ?? 1;
        //    var onePageOfProducts = obj.lstOfsetSetUpMemberShipModel.ToPagedList(pageNumber, 25);
        //    ViewBag.OnePageOfProducts = onePageOfProducts;
        //    return View(obj);
        //}



        public ActionResult Index(int?page)
        {
            SetUpMemberShipModel obj = new SetUpMemberShipModel();

            SetUpMemberShipProvider pro = new SetUpMemberShipProvider();

            obj.lstOfsetSetUpMemberShipModel = pro.Getlist();

            var pageNumber = page ?? 1;

            //var onePageOfProducts = obj.lstOfsetSetUpMemberShipModel.ToPagedList(pageNumber, 25);

            //ViewBag.OnePageOfProducts = onePageOfProducts;

            return(View(obj));
        }
        public int Insert(SetUpMemberShipModel model)
        {
            int i = 0;


            using (EHMSEntities ent = new EHMSEntities())
            {
                var objToSave = AutoMapper.Mapper.Map <SetUpMemberShipModel, SetupMemberShip>(model);
                objToSave.CreatedBy   = 0;
                objToSave.CreatedDate = DateTime.Now;

                ent.SetupMemberShips.Add(objToSave);
                i = ent.SaveChanges();
            }

            return(i);
        }
Beispiel #8
0
        public ActionResult MemberSelf(int Id, string FirstName, int MembertypeId, int MaxDepend, int DueDepend)
        {
            OpdModel opdobj = new OpdModel();

            // SetUpMemberShipModel setupmemobj = new SetUpMemberShipModel();
            EHMSEntities ent = new EHMSEntities();


            var obj = ent.SetupMemberShips.Where(x => x.SetupMemberID == Id).FirstOrDefault();

            SetUpMemberShipModel setupmemobj = AutoMapper.Mapper.Map <SetupMemberShip, SetUpMemberShipModel>(obj);

            // opdobj = AutoMapper.Mapper.Map<SetUpMemberShipModel, OpdModel>(setupmemobj);


            // OpdModel opdobj = AutoMapper.Mapper.Map<SetUpMemberShipModel, OpdModel>(setupmemobj);
            opdobj.IsMember     = 1;
            opdobj.CountryID    = setupmemobj.CountryID;
            opdobj.FirstName    = setupmemobj.FirstName;
            opdobj.MiddleName   = setupmemobj.MiddleName;
            opdobj.LastName     = setupmemobj.LastName;
            opdobj.Address      = setupmemobj.Address;
            obj.Gender          = setupmemobj.Gender;
            opdobj.BloodGroup   = setupmemobj.BloodGroupID.ToString();
            opdobj.ContactName  = setupmemobj.ContactNumber;
            opdobj.MobileNumber = setupmemobj.MobileNumber;
            opdobj.Email        = setupmemobj.Email;
            opdobj.MemberTypeID = setupmemobj.MemberTypeID;

            opdobj.AgeYear = DateTime.Now.Year - setupmemobj.DateofBirth.Year;

            opdobj.OpdFeeDetailsModel = new OpdFeeDetailsModel();
            opdobj.OpdFeeDetailsModel.RegistrationFee = Utility.GetCurrentRegistrationFee();
            opdobj.OpdFeeDetailsModel.TotalAmount     = Utility.GetCurrentRegistrationFee();


            for (int i = 1; i <= 1; i++)
            {
                var mod = new OpdDoctorListModel();

                opdobj.OpdDoctorList.Add(mod);
            }

            return(View("Create", opdobj));
        }
        //public void Update(OperationTheatreRoomModel model)
        //{
        //    using (EHMSEntities ent = new EHMSEntities())
        //    {
        //        var objtoedit = ent.SetupOperationTheatreRoom.Where(x => x.OperationTheatreRoomID == model.OperationTheatreRoomID).FirstOrDefault();
        //        AutoMapper.Mapper.Map(model, objtoedit);
        //        objtoedit.Stats = true;
        //        //objtoedit.ValidUpto = Convert.ToDateTime(model.date);
        //        ent.Entry(objtoedit).State = System.Data.EntityState.Modified;
        //        ent.SaveChanges();
        //    }
        //}



        public int Update(SetUpMemberShipModel model)
        {
            int i = 0;

            using (EHMSEntities ent = new EHMSEntities())
            {
                var objtosave = ent.SetupMemberShips.Where(x => x.SetupMemberID == model.SetupMemberID).SingleOrDefault();

                model.CreatedBy   = objtosave.CreatedBy;
                model.CreatedDate = objtosave.CreatedDate;
                model.Status      = objtosave.Status;

                AutoMapper.Mapper.Map(model, objtosave);

                ent.Entry(objtosave).State = System.Data.EntityState.Modified;

                i = ent.SaveChanges();
            }

            return(i);
        }
Beispiel #10
0
        public ActionResult Create(SetUpMemberShipModel model)
        {
            if (ModelState.IsValid)
            {
                HospitalManagementSystem.Providers.SetUpMemberShipProvider obj = new SetUpMemberShipProvider();

                int i = obj.Insert(model);

                if (i != 0)
                {
                    TempData["success"] = HospitalManagementSystem.UtilityMessage.save;
                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["success"] = HospitalManagementSystem.UtilityMessage.savefailed;
                    return(RedirectToAction("Index"));
                }
            }
            return(View("Index"));
        }
Beispiel #11
0
        public ActionResult Edit(SetUpMemberShipModel model)
        {
            if (ModelState.IsValid)
            {
                SetUpMemberShipProvider obj = new SetUpMemberShipProvider();
                int i = obj.Update(model);

                if (i != 0)
                {
                    TempData["success"] = HospitalManagementSystem.UtilityMessage.edit;
                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["success"] = HospitalManagementSystem.UtilityMessage.editfailed;
                    return(RedirectToAction("Index"));
                }
            }


            return(RedirectToAction("Index"));
        }
Beispiel #12
0
        //
        // GET: /SetUpMemberShip/


        public ActionResult GetMemberShipListWithValue(string id)
        {
            SetUpMemberShipProvider pro = new SetUpMemberShipProvider();

            SetUpMemberShipModel obj = new SetUpMemberShipModel();

            obj.lstOfsetSetUpMemberShipModel = pro.GetlistWithName(id);

            foreach (var item in obj.lstOfsetSetUpMemberShipModel)
            {
                using (EHMSEntities ent = new EHMSEntities())
                {
                    item.cnt = (from x in ent.SetupMemberDependents
                                where x.SetupMemberID == item.SetupMemberID
                                select x).ToList().Count();

                    item.cnt = item.MaximumDependent - item.cnt;
                }
            }


            return(PartialView("GetMemberShipList", obj));
        }