public ActionResult EditMember()
        {
            Member model = new Member();
            // var Member = _MemberBAL.GetByName(Convert.ToInt32(Session["MembershipNo"].ToString()));
            var Member = _MemberBAL.GetByName(User.Identity.Name);

            ViewBag.MemberLookUp = new MemberBAL().GetMemberLookUp();

            model = new MemberBAL().GetById(Member.MemberId);

            return View(model);
        }
        public ActionResult Manage(int? id)
        {
            Member model = new Member();
            model.Password = Common.GetRandomValue();
            model.MemberShipNo = Convert.ToInt32(MemberBAL.GetMembershipNo());
            model.Intrest = 8;
            ViewBag.MemberLookUp = new MemberBAL().GetMemberLookUp();
            if (id != 0 && id != null)
            {
                model = new MemberBAL().GetById(id.Value);
            }

            return View(model);
        }
Example #3
0
 public void Create(Member oMember)
 {
     try
     {
         using (var ctx = new BHGroupEntities())
         {
             oMember.CreateOn = System.DateTime.Now;
             ctx.Members.Add(oMember);
             ctx.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ActionResult Save(Member model)
 {
     try
     {
         bool Add_Flag = new MemberBAL().isNewEntry(model.MemberId);
         if (Add_Flag)
             new MemberBAL().Create(model);
         else
             new MemberBAL().Update(model);
         string message = CommonMsg.Success(EntityNames.Member, Add_Flag == true ? En_CRUD.Insert : En_CRUD.Update);
         TempData["successmsg"] = message;
     }
     catch (Exception ex)
     {
         TempData["errormsg"] = ex.Message;
     }
     return Redirect("Index");
 }
        public ActionResult Save(Member model)
        {
            try
            {

                new MemberBAL().Update(model);

                TempData["successmsg"] = "Profile Updated Successfully";
            }
            catch (Exception ex)
            {
                TempData["errormsg"] = ex.Message;
            }
            return Redirect("EditMember");
        }
Example #6
0
        public void Update(Member oMember)
        {
            try
            {
                using (var ctx = new BHGroupEntities())
                {

                    ctx.Entry(oMember).State = EntityState.Modified;
                    ctx.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }