public bool AddUser(string login, string password, string type, List <string> args) { string hash = MakeHash(login, password); using (var context = new LaborExchangeEntities()) { if (Enumerable.Any(context.Logins, contextLogin => contextLogin.Username == login)) { return(false); } var l = new Logins { Username = login, Pass = hash, UserType = type }; context.Logins.Add(l); switch (type) { case "Company": if (!AddCompany(l, args)) { return(false); } break; case "Employee": if (!AddEmployee(l, args)) { return(false); } break; } context.SaveChanges(); return(true); } }
private bool AddCompany(Logins l, List <string> args) { return(false); }
private bool AddEmployee(Logins l, List <string> args) { return(false); }