Ejemplo n.º 1
0
        public ActionResult Registration(PartnerRegistration partner)
        {
            if (ModelState.IsValid)
            {
                var user = AgroExpressDBAccess.IsUserExist(partner.UserName);
                if (user != null)
                {
                    ModelState.AddModelError("UserName", "User name already exist");
                    return(View(partner));
                }

                if (AgroExpressDBAccess.AddPartner(partner))
                {
                    ViewBag.success = "Registration Successsfull";
                    ModelState.Clear();
                    PartnerRegistration registration = new PartnerRegistration();
                    return(View(registration));
                }
            }
            return(View(partner));
        }