Exemplo n.º 1
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            if (Session["User"] == null)
            {
                return(RedirectToAction("Login", "Pages"));
            }

            try
            {
                BL.User user = BL.User.getById(id);
                user.Username = collection["Username"];

                // If a password has been specified, let's update the user's old password
                if (collection["Password"] != "")
                {
                    user.Password = Settings.SecureString(collection["Password"]);
                }

                user.save();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 2
0
        public ActionResult VendorRegister(string FullName, int NationalId, string Bio)
        {
            User_table USer = (User_table)Session["user"];

            int id = USer.User_Id;

            BL.User user = new BL.User();
            ViewBag.message = user.Vendor_Register(FullName, NationalId, Bio, id);
            return(PartialView());
        }
Exemplo n.º 3
0
        //Selected User
        public ActionResult SelectedUser(int id)
        {
            Session.Add("profileid", id);
            BL.User    user         = new BL.User();
            User_table selecteduser = user.GetSelectedUser(id);

            ViewBag.user_id = selecteduser.User_Id;
            Product product = new Product();

            ViewBag.VendorProducts            = product.GetProductsOfvendor(id);
            ViewBag.BestSellingVendorProducts = product.BestSellingForVendor(id);

            if (Session["user"] != null)
            {
                ViewBag.substate = vendorlogic.checkfollow((int)Session["User_Id"], id);
            }

            return(View(selecteduser));
        }
Exemplo n.º 4
0
        public ActionResult Create(FormCollection collection)
        {
            if (Session["User"] == null)
            {
                return(RedirectToAction("Login", "Pages"));
            }

            try
            {
                // Let's create a new user and fill it with form's data
                BL.User user = new BL.User();
                user.Username = collection["Username"];
                user.Password = Settings.SecureString(collection["Password"]);

                user.save();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 5
0
 private void detach_Users(User entity)
 {
     this.SendPropertyChanging();
     entity.UserRole = null;
 }
Exemplo n.º 6
0
 private void attach_Users(User entity)
 {
     this.SendPropertyChanging();
     entity.UserRole = this;
 }
Exemplo n.º 7
0
 partial void DeleteUser(User instance);
Exemplo n.º 8
0
 partial void UpdateUser(User instance);
Exemplo n.º 9
0
 partial void InsertUser(User instance);
Exemplo n.º 10
0
 public void Add(User<int> value)
 {
     userDao.Add(value);
 }