public string CheckInDatabaseAndAdd(string firstName, string lastName, string id, string mail) { JavaScriptSerializer j = new JavaScriptSerializer(); UserT temp_user = new UserT(); temp_user.FirstName = firstName; temp_user.LastName = lastName; temp_user.Mail = mail; temp_user.UserId = id; if (!temp_user.CheckIfExictById()) { temp_user.InsertUser(); temp_user.AddMursheManager(); //insert to users } else { //בודקת אם קיים באדמין או לא if (temp_user.CheckUserInAdmin()) { return("המשתמש כבר הוגדר בעבר כמנהל מערכת"); } //מוסיפה לטבלת אדמין else { temp_user.AddMursheManager(); } } return("המשתמש הוגדר כמנהל מערכת בהצלחה"); }
public string AddUser(string mail, string pass, string first, string last, string id) { JavaScriptSerializer j = new JavaScriptSerializer(); UserT temp = new UserT(mail, pass); temp.UserId = id; if (!temp.CheckIfExictById()) { temp.FirstName = first; temp.LastName = last; temp.Mail = mail; temp.InsertUser(); return(j.Serialize("True")); } else { return(j.Serialize("False")); } }
public string AddUserAllInfo(string id, string phone, int city, string street, string num) { JavaScriptSerializer j = new JavaScriptSerializer(); UserT temp = new UserT(); temp.UserId = id; if (temp.CheckIfExictById()) { City C = new City(); C.CityCode = city; temp.City = C; //temp.LastName = last; //temp.Mail = mail; temp.UpdateUser(); return(j.Serialize("True")); } else { return(j.Serialize("False")); } }