Ejemplo n.º 1
0
        public ActionResult AddNewOrder(Orders orders)
        {
            dal.Orders.Add(orders);
            dal.SaveChanges();

            return(Redirect("/Orders/Orders/" + orders.UserID));
        }
Ejemplo n.º 2
0
        public ActionResult SignUp(login_Signup ls)
        {
            if (ModelState.IsValid)
            {
                var check = new ChackUserToLogIn();
                var _id   = string.Empty;
                ls.Password     = new EncryptDecrypt().Encript(ls.Password);
                ls.FirstName    = ls.FirstName.ToLower();
                ls.LastName     = ls.LastName.ToLower();
                ls.EmailAddress = ls.EmailAddress.ToLower();
                dal.Users.Add(ls);
                dal.SaveChanges();

                var result = check.CheckUser(dal, ls.Password, ls.EmailAddress, out _id);

                if (result && _id != string.Empty)
                {
                    Session["UserID"] = Guid.NewGuid();
                }

                int id = int.Parse(_id);

                return(Redirect("/Orders/Orders/" + id));
            }
            else
            {
                return(View("LoginSignup"));
            }
        }