Beispiel #1
0
        public ActionResult AddMember(LibMember newmember)
        {
            if (ModelState.IsValid)
            {
                //MemberValidation membervalidation = new MemberValidation();
                AbstractFactory   abstractfactory  = FactoryProducer.GetFactory("IMemberValidation");
                IMemberValidation membervalidation = abstractfactory.getmembervalidation("MemberValidation");
                if (membervalidation.ValidateMember(newmember))
                {
                    MemberTable memberTable = new MemberTable(db);
                    memberTable.Insert(newmember);
                    ModelState.Clear();

                    ViewBag.Message = newmember.Firstname + ProjectConstants.SuccessMsg;
                }
                else
                {
                    ViewBag.Message1 = ProjectConstants.MemberExistingMsg;
                }
            }
            return(View(ProjectConstants.AddMember));
        }
Beispiel #2
0
 public MemberManager(IMemberValidation memberValidation)
 {
     _memberValidation = memberValidation;
 }