Exemplo n.º 1
0
        public ActionResult Create(MemberModel membr)
        {
            MembersData MemRepo = new MembersData();

            //if (ModelState.IsValid)
            //{
            ResponseModel isSave = MemRepo.SaveMember(membr);

            if (isSave.status == 1)
            {
                Connection.CommitTransaction();
                Connection.CloseConnection();
                return(Json(new { status = true, code = 2, msg = "Successfuly Created." }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                Connection.RollbackTransaction();
                Connection.CloseConnection();
                return(Json(new { status = false, code = 0, msg = "Something went wrong." }, JsonRequestBehavior.AllowGet));
            }
            //}

            MemberModel mem = new MemberModel();

            mem.ListyearOfMembership = GetYearofMembership();
            mem.StatusList           = MemRepo.GetStatusList(); //MemRepo.GetStatusList_1();
            mem.PositionList         = MemRepo.GetPositionList();
            mem.CLPList        = GetCLPNumList();
            mem.ChapList       = MemRepo.GetChapterList();
            mem.AccessTypeList = MemRepo.GetAcccessTypeList();
            mem.SponsorList    = MemRepo.GetSponsorList();
            return(Json(new { status = false, code = 0, msg = "Something went wrong." }, JsonRequestBehavior.AllowGet));
            //return RedirectToAction("Index");
        }
Exemplo n.º 2
0
        public ActionResult Create()
        {
            MembersData MemRepo = new MembersData();
            MemberModel mem     = new MemberModel();

            mem.ListyearOfMembership = GetYearofMembership();
            mem.StatusList           = MemRepo.GetStatusList();
            mem.PositionList         = MemRepo.GetPositionList();
            mem.CLPList        = GetCLPNumList();
            mem.ChapList       = MemRepo.GetChapterList();
            mem.AccessTypeList = MemRepo.GetAcccessTypeList();
            mem.SponsorList    = MemRepo.GetSponsorList();
            return(View(mem));
        }
Exemplo n.º 3
0
        public ActionResult Edit(int id)
        {
            MembersData MemRepo = new MembersData();
            MemberModel mem     = MembersData.MemberDetails(id);

            if (mem != null)
            {
                mem.ListyearOfMembership = GetYearofMembership();
                mem.StatusList           = MemRepo.GetStatusList();
                mem.PositionList         = MemRepo.GetPositionList();
                mem.CLPList        = GetCLPNumList();
                mem.ChapList       = MemRepo.GetChapterList();
                mem.AccessTypeList = MemRepo.GetAcccessTypeList();
                mem.SponsorList    = MemRepo.GetSponsorList();
            }
            return(View(mem));

            //return Json(new { status = true, msg = "Success", data = mem }, JsonRequestBehavior.AllowGet);
        }