public void OnPostVerifyUser() { if (FormFilled()) { if (VerifyPassword()) { alertSuccess = true; DBRepos repos = new DBRepos(); user_controller user = repos.GetUserByUserID(LoginUser.loginUsername); // login succesvol HttpContext.Session.SetString("LoginSession", user.user_id.ToString()); if (user.admin == true) { Response.Redirect("adminpage"); } else { Response.Redirect("index"); } } else { alertDanger = true; } } else { alertDanger = true; } }
public ValuePhoto GetOrderPhoto(int picture_id) { ValuePhoto photos = new DBRepos().GetById(picture_id); totalPrice += photos.price; return(photos); }
public void OnGet() { //string cookieStr = Request.Cookies["cookieLogin"]; string SessionCookie = HttpContext.Session.GetString("LoginSession"); DBRepos repos = new DBRepos(); user_controller user = repos.GetUserByID(Convert.ToInt32(SessionCookie)); if (SessionCookie != null) { Label = "Welcome, " + FirstLetterToUpper(user.username.ToString()) + "!"; } }
public int TotalPhotoByOrder(int Order_id) { int TotalPhotos = new DBRepos().GetPhotosOrder(Order_id); return(TotalPhotos); }
public string UserByOrder(int user_id) { user_controller UserById = new DBRepos().GetUserByID(user_id); return(UserById.username); }
public DbDataOperation(DBRepos rep) { db = rep; }