}//End page_Init //Store Users ID for faster logging protected void storeUserSessionInfo(string NTID) { using (var curDB = new HelpDesk_DB()) { NetworkLogin user = curDB.NetworkLogins.SingleOrDefault(p => p.ntID == NTID); Session["username"] = NTID; Session["userID"] = user.id; Session["firstName"] = user.firstName; Session["lastName"] = user.lastName; } }
/// <summary> /// Checks if NTID exists in NetworkLogin Table, if not adds the user to the table and returns false /// </summary> protected Boolean registeredUser(string NTID) { using (var curDB = new HelpDesk_DB()) { NetworkLogin user = curDB.NetworkLogins.SingleOrDefault(p => p.ntID == NTID); if (user.firstName == null || user.lastName == null) { return(false); } } return(true); }
protected void addNewUser(string NTID) { using (var curDB = new HelpDesk_DB()) { NetworkLogin newUser = new NetworkLogin(); newUser.ntID = NTID; newUser.status = "Current"; curDB.NetworkLogins.Add(newUser); curDB.SaveChanges(); } }
/// <summary> /// Checks if NTID exists in NetworkLogin Table, if not adds the user to the table and returns false /// </summary> protected Boolean existingUser(string NTID) { using (var curDB = new HelpDesk_DB()) { //If user is new add them to NetworkLogin table NetworkLogin user = curDB.NetworkLogins.SingleOrDefault(p => p.ntID == NTID); if (user == null) { return(false); } } return(true); }