Exemplo n.º 1
0
        public ActionResult Index(FormCollection frmCollection)
        {
            bool IsDriver = false;

            if (Request.Form["IsDriver"] != null)
            {
                IsDriver = true;
            }


            if (frmCollection["passwd"].ToString() == frmCollection["cnfPassword"].ToString())
            {
                User ObjUser = new User();
                ObjUser.FirstName = frmCollection["firstname"];
                ObjUser.LastName  = frmCollection["lastname"];
                ObjUser.Email     = frmCollection["email"];
                ObjUser.Password  = frmCollection["passwd"];
                ObjUser.IsDriver  = IsDriver;
                ObjUser.LisenceNo = 2323;

                UserDataLayer UserDataLayer = new UserDataLayer();

                UserReponse Response = UserDataLayer.InsertUserAndGetResponse(ObjUser);

                if (Response.ResultCode == ResultCodes.Error)
                {
                    ViewBag.InfoError = Response.Message;
                }
                else if (Response.ResultCode == ResultCodes.Exists)
                {
                    ViewBag.InfoMessage = Response.Message;
                }
                else if (Response.ResultCode == ResultCodes.Success)
                {
                    ViewBag.InfoMessage = Response.Message;
                }
            }
            else
            {
                ViewBag.InfoError = "Password doesnt Match!!!";
            }



            return(View());
        }