Example #1
0
        public ActionResult Register()
        {
            Users u = new Users();

            u.FullName = Convert.ToString(Request.Form["Name"]);
            u.Country  = Convert.ToString(Request.Form["Country"]);
            //u.Email = Convert.ToString(Request.Form["Email"]);
            u.Phone    = Convert.ToString(Request.Form["PhoneNumber"]);
            u.Login    = Convert.ToString(Request.Form["Username"]);
            u.Password = Convert.ToString(Request.Form["Password"]);
            u.Email    = u.Login;
            u.Type     = 1;
            u.UserType = 3;

            db.Users.Add(u);
            db.SaveChanges();

            Session["Active"] = "1";
            Session["User"]   = u.ID;
            Session["Type"]   = u.Type;

            if (Session["Active"] == "1")
            {
                return(RedirectToAction("PersonalCabinet", "Home"));
            }

            return(RedirectToAction("Login", "Account"));
        }
Example #2
0
        public ActionResult Proba()
        {
            foreach (var items in db.Adses)
            {
                if (items.Date.Value.AddMonths(1).CompareTo(DateTime.Now) < 0)
                {
                    items.Sales            = 3;
                    items.Accept_Rejection = 3;
                }
                db.Entry(items);
            }

            db.SaveChanges();

            return(View(db.Adses));
        }
Example #3
0
        public ActionResult Index()
        {
            Session["Lang"] = 2;

            foreach (var items in db.Adses)
            {
                if (items.Date.Value.AddMonths(1).CompareTo(DateTime.Now) < 0)
                {
                    items.Sales = 3;
                }
                db.Entry(items);
            }

            db.SaveChanges();

            return(View(db.Adses.Where(x => x.Sales == 2)));
        }