public async Task <Boolean> CreateNewUser(EmpInDAL emp) { try { var result = await IEmp.AddEmp(emp); return(true); } catch (Exception e) { return(false); } }
public async Task <Boolean> AddUser(Emps e) { EmpInDAL newemp = new EmpInDAL { FirstName = e.FirstName, LastName = e.LastName, Gender = e.Gender, dateTime = e.OnTimeCreated, Address = e.Address, Email = e.Email, Mobile = e.Mobile, UserName = e.UserName, Password = e.Password, ConfirmPassword = e.ConfirmPassword }; bool result = await UL.CreateNewUser(newemp); return(result); }
public async Task <EmpInDAL> AddEmp(EmpInDAL emp) { EmpInDAL newemp = new EmpInDAL { FirstName = emp.FirstName, LastName = emp.LastName, Gender = emp.Gender, dateTime = emp.dateTime, Address = emp.Address, Email = emp.Email, Mobile = emp.Mobile, UserName = emp.UserName, Password = emp.Password, ConfirmPassword = emp.ConfirmPassword }; using (var context = new DataBaseContext(DataBaseContext.ops.dbOptions)) { await context.Emp.AddAsync(newemp); await context.SaveChangesAsync(); } return(newemp); }