Пример #1
0
        public ActionResult Registration(mvcmodelreg mr)
        {
            if (ModelState.IsValid)
            {
                var config = new MapperConfiguration(cfg =>
                {
                    cfg.CreateMap <mvcmodelreg, modelreg>();
                });

                IMapper mapper = config.CreateMapper();

                var dest = mapper.Map <mvcmodelreg, modelreg>(mr);
                var t    = b.verifyDbEmail(dest.EMail);
                if (t)
                {
                    ViewBag.message1 = "User already Exists!!";
                }
                else
                {
                    var k = b.addDbData(dest);
                    if (k)
                    {
                        ViewBag.message = "Data recorded";
                    }
                    else
                    {
                        ViewBag.message = "Invalid Data ";
                    }
                }
            }
            return(View());
        }