Пример #1
0
        public async Task <Boolean> CreateNewUser(EmpInDAL emp)
        {
            try
            {
                var result = await IEmp.AddEmp(emp);

                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }