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()); } }
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()); }
//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)); }
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()); } }
private void detach_Users(User entity) { this.SendPropertyChanging(); entity.UserRole = null; }
private void attach_Users(User entity) { this.SendPropertyChanging(); entity.UserRole = this; }
partial void DeleteUser(User instance);
partial void UpdateUser(User instance);
partial void InsertUser(User instance);
public void Add(User<int> value) { userDao.Add(value); }