public bool createAdminUser(string fname, string lname, string email, string password, string phNumber, string gender, string address, string dob, string grade, string branch, string role, string reportingTo) { Boolean flag = false; using (HREntities db = new HREntities()) { try { var Candidate = db.Set <UserManagement>(); Candidate.Add(new UserManagement { firstName = fname, LastName = lname, email = email, password = password, phone = phNumber, gender = gender, address1 = address, dob = Convert.ToDateTime(dob), grade = grade, branchId = Convert.ToInt32(branch), roles = role, reportingTo = Convert.ToInt32(reportingTo) }); db.SaveChanges(); flag = true; } catch (Exception) { throw; } } return(flag); }
public bool createUser(string fname, string lname, string email, string password, string phNumber, string gender) { Boolean flag = false; using (HREntities db = new HREntities()) { try { var Candidate = db.Set <Candidate>(); Candidate.Add(new Candidate { firstname = fname, lastname = lname, emialid = email, password = password, contact = phNumber, gender = gender }); db.SaveChanges(); flag = true; } catch (Exception) { throw; } } return(flag); }