Exemplo n.º 1
0
        public static bool Insert(UserMasterDto user)
        {
            string sql = " INSERT INTO tblUserMaster (UserName,Password,UserFullName,DateOfBirth,Email,PhoneNumber,AccountType,Rating) " +
                         "VALUES " +
                         " ( @UserName,@Password,@UserFullName,@DateOfBirth,@Email,@PhoneNumber,@AccountType,@Rating)";
            SqlConnection con = new SqlConnection(Properties.Settings.Default.BlindEyeDBConStr);
            SqlCommand    cmd = new SqlCommand(sql, con);

            cmd.Parameters.AddWithValue("@UserName", user.UserName);
            cmd.Parameters.AddWithValue("@Password", user.Password);
            cmd.Parameters.AddWithValue("@UserFullName", user.UserFullName);
            cmd.Parameters.AddWithValue("@DateOfBirth", user.DateOfBirth);
            cmd.Parameters.AddWithValue("@Email", user.Email);
            cmd.Parameters.AddWithValue("@PhoneNumber", user.PhoneNumber);
            cmd.Parameters.AddWithValue("@AccountType", user.AccountType);
            cmd.Parameters.AddWithValue("@Rating", user.Rating);
            try
            {
                con.Open();
                cmd.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                Constant.DBErrorMsg = ex.Message;

                return(false);
            }

            finally
            {
                con.Close();
            }
        }
Exemplo n.º 2
0
        public static bool ResetPasswordUpdate(UserMasterDto user)
        {
            string        sql = " UPDATE tblUserMaster SET Password=@Password  WHERE UserName=@UserName";
            SqlConnection con = new SqlConnection(Properties.Settings.Default.BlindEyeDBConStr);
            SqlCommand    cmd = new SqlCommand(sql, con);


            cmd.Parameters.AddWithValue("@UserName", user.UserName);
            cmd.Parameters.AddWithValue("@Password", user.Password);

            try
            {
                con.Open();
                cmd.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                Constant.DBErrorMsg = ex.Message;

                return(false);
            }

            finally
            {
                con.Close();
            }
        }
Exemplo n.º 3
0
        public static bool Update(UserMasterDto user)
        {
            string        sql = " UPDATE tblUserMaster SET UserName=@UserName,Password=@Password,UserFullName=@UserFullName,DateOfBirth=@DateOfBirth,Email=@Email,PhoneNumber=@PhoneNumber,AccountType=@AccountType,Rating=@Rating  WHERE UserMasterID=@UserMasterID";
            SqlConnection con = new SqlConnection(Properties.Settings.Default.BlindEyeDBConStr);
            SqlCommand    cmd = new SqlCommand(sql, con);

            cmd.Parameters.AddWithValue("@UserMasterID", user.UserMasterID);
            cmd.Parameters.AddWithValue("@UserName", user.UserName);
            cmd.Parameters.AddWithValue("@Password", user.Password);
            cmd.Parameters.AddWithValue("@UserFullName", user.UserFullName);
            cmd.Parameters.AddWithValue("@DateOfBirth", user.DateOfBirth);
            cmd.Parameters.AddWithValue("@Email", user.Email);
            cmd.Parameters.AddWithValue("@PhoneNumber", user.PhoneNumber);
            cmd.Parameters.AddWithValue("@AccountType", user.AccountType);
            cmd.Parameters.AddWithValue("@Rating", user.Rating);
            try
            {
                con.Open();
                cmd.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                Constant.DBErrorMsg = ex.Message;

                return(false);
            }

            finally
            {
                con.Close();
            }
        }
Exemplo n.º 4
0
 public frmResetPassword(UserMasterDto user)
 {
     InitializeComponent();
     this.user            = user;
     textUserName.Text    = this.user.UserName;
     textUserName.Enabled = false;
 }
Exemplo n.º 5
0
        public ActionResult AddUser()
        {
            var userDto = new UserMasterDto();

            userDto.UserTypesDtos = _iUserHelper.GetUserTypes();
            return(View("AddUser", userDto));
        }
Exemplo n.º 6
0
        public ServiceResponse UserMaster(UserMasterDto dto)
        {
            _result = new ServiceResponse();
            try
            {
                Guid systemSession = DevelopmentManagerFactory.GetSystemSession();
                IDevelopmentManager developmentManager = DevelopmentManagerFactory.GetDevelopmentManager(systemSession);
                _result.StatusCode = (int)HttpStatusCode.OK;
                var dao = new UserMasterDao
                {
                    UserName                = dto.UserName,
                    MobileNumber            = dto.MobileNumber,
                    Address                 = dto.Address,
                    Street                  = dto.Street,
                    City                    = dto.City,
                    State                   = dto.State,
                    Category                = dto.Category,
                    InterestedIn            = dto.InterestedIn,
                    RadiusOnWhereCanOperate = dto.RadiusOnWhereCanOperate,
                    AreaWhereCanOperate     = dto.AreaWhereCanOperate
                };

                _result.Response = developmentManager.CommonManager.SaveUserMaster(dao);
            }
            catch
            {
                _result.StatusCode = (int)HttpStatusCode.MethodNotAllowed;
                _result.Response   = null;
            }
            return(_result);
        }
        public long DeleteUser(UserMasterDto model)
        {
            Mapper.CreateMap <UserMasterDto, UserMst>();
            UserMst tbluser = Mapper.Map <UserMasterDto, UserMst>(model);

            _userMasterRepository.DeleteUserDetails(tbluser, _dbContext);
            return(_dbContext.SaveChanges());
        }
        public async Task PrepareAndSendEmailAsync(UserMasterDto user, string otherText, AspectEnums.TemplateType type, AspectEnums.EmailTemplateCode?code)
        {
            var template = await _emailRepository.GetEmailWithFieldsAsync(type, code);

            var email = PrepareEmailBody(user, otherText, template);

            await SendEmailAsync(email);
        }
        public long UpdateUserActiveStatus(UserMasterDto model)
        {
            Mapper.CreateMap <UserMasterDto, UserMst>();
            UserMst tbluser          = Mapper.Map <UserMasterDto, UserMst>(model);
            var     existingUserData = _userMasterRepository.GetAllUserDetails(_dbContext)
                                       .Where(x => x.UserId == model.UserId)
                                       .FirstOrDefault();

            return(_userMasterRepository.UpdateUserActiveStatus(tbluser, _dbContext));
        }
Exemplo n.º 10
0
        public int SaveUser(UserMasterDto model)
        {
            UserMaster user = new UserMaster();

            user = _userMapper.MapToUserDto(model);
            _context.Users.Add(user);
            _context.SaveChanges();

            return(user.ID);
        }
Exemplo n.º 11
0
 private void dgvUserList_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex > -1)
     {
         _UserMasterID = Convert.ToInt64(dgvUserList.Rows[e.RowIndex].Cells[0].Value);
         UserMasterDto user = new UserMasterDto();
         user = UserMasterDao.GetByUserMasterID(_UserMasterID);
         FromObjectToFrom(user);
     }
 }
        public async Task <ActionResult> UpdateExistingUser([FromBody] UserMasterDto user)
        {
            if (user == null)
            {
                return(BadRequest());
            }

            await _userBusinessInstance.UpdateUserAsync(user);

            return(Ok());
        }
        public UserMasterDto GetUserById(long Id)
        {
            UserMasterDto result   = new UserMasterDto();
            var           received = _userMasterRepository.GetAllUserDetails(_dbContext)
                                     .Where(x => x.UserId == Id)
                                     .FirstOrDefault();

            Mapper.CreateMap <UserMst, UserMasterDto>();
            result = Mapper.Map <UserMst, UserMasterDto>(received);

            return(result);
        }
Exemplo n.º 14
0
        private void button1_Click(object sender, EventArgs e)
        {
            UserMasterDto ud = new UserMasterDto();

            ud = UserMasterDao.GetByUserMasterUsername(txtSearch.Text);
            if (ud != null)
            {
                lblName.Text  += "  " + ud.UserFullName;
                lblEmail.Text += "  " + ud.Email;
                lblPhone.Text += " " + ud.PhoneNumber;
            }
        }
Exemplo n.º 15
0
 public MDIParent(UserMasterDto user)
 {
     InitializeComponent();
     this.user           = user;
     tslblUserName.Text += " : " + user.UserFullName;
     _UserMasterID       = this.user.UserMasterID;
     if (user.AccountType == 1)
     {
         btnSellProduct.Enabled        = false;
         userToolStripMenuItem.Enabled = false;
         btnVendorSettings.Enabled     = false;
     }
 }
Exemplo n.º 16
0
        private void FromObjectToFrom(UserMasterDto user)
        {
            cmbAcctType.SelectedValue = user.AccountType.ToString();
            txtUserFullName.Text      = user.UserFullName;
            txtPhoneNumber.Text       = user.PhoneNumber;
            txtPassword.Text          = user.Password;
            txtEmail.Text             = user.Email;
            textUserName.Text         = user.UserName;
            dtpDateOfBirth.Value      = user.DateOfBirth;

            txtPassword.Enabled  = false;
            textUserName.Enabled = false;
        }
        public async Task SendAlreadyRegisteredEmail(UserMasterDto user)
        {
            var template = new EmailTemplate();

            string message = $@"<p>If you don't know your password please visit the <a href=""{_baseUrl}/account/forgot-password"">forgot password</a> page.</p>";

            template.Subject     = "Sign-up Verification API - Email Already Registered";
            template.HtmlContent = $@"<h4>Email Already Registered</h4>
                         <p>Your email <strong>{{EMAIL}}</strong> is already registered.</p>
                         {message}";
            var email = PrepareEmailBody(user, String.Empty, template);

            await SendEmailAsync(email);
        }
Exemplo n.º 18
0
        public bool authenticate(UserMasterDto user, string username, string password)
        {
            byte[] salt           = user.Salt;
            string hashedPassword = hash(password, salt);

            if (username == user.Name && hashedPassword == user.Password)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 19
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtRetypePassword.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtNewPassword.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (textUserName.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtPassword.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtNewPassword.Text != txtRetypePassword.Text)
            {
                MessageBox.Show("Password doesn't match", "Password match error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            UserMasterDto user = new UserMasterDto();

            user.UserName = textUserName.Text.Trim();
            user.Password = txtNewPassword.Text;

            if (UserMasterDao.ResetPasswordUpdate(user))
            {
                MessageBox.Show(Constant.NOTIFICATION_SUCCESS_DATA_SAVING, Constant.NOTIFICATION_CAPTION_SAVE, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                txtNewPassword.Text    = string.Empty;
                txtPassword.Text       = string.Empty;
                txtRetypePassword.Text = string.Empty;
                textUserName.Text      = string.Empty;
                this.Close();
            }
            else
            {
                MessageBox.Show(Constant.DBErrorMsg, Constant.NOTIFICATION_ERROR_DATA_SAVING, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public async Task <ActionResult> RegisterUser([FromBody] UserMasterDto user)
        {
            if (user == null)
            {
                return(BadRequest());
            }
            var userExists = await _userBusinessInstance.IsUserAlreadyExists(user.Email);

            if (userExists)
            {
                throw new AppException("User with email address: " + user.Email + " already registered with us. Please follow the email we sent now.");
            }

            var id = await _userBusinessInstance.AddNewUserAsync(user);

            return(Ok(new { SingleResult = id, IsSuccess = true }));
        }
Exemplo n.º 21
0
        public static UserMasterDto GetByUserMasterUsername(string username)
        {
            UserMasterDto user;

            string sql = "SELECT UserMasterID,UserName,Password,UserFullName,DateOfBirth,Email,PhoneNumber,AccountType,Rating  FROM tblUserMaster WHERE UserFullName=@UserFullName";

            Console.WriteLine(sql);
            SqlConnection con = new SqlConnection(Properties.Settings.Default.BlindEyeDBConStr);
            SqlCommand    cmd = new SqlCommand(sql, con);

            cmd.Parameters.AddWithValue("@UserFullName", username);

            try
            {
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    user = new UserMasterDto();
                    user.UserMasterID = Convert.ToInt64(rdr["UserMasterID"]);

                    user.UserName     = Convert.ToString(rdr["UserName"]);
                    user.Password     = Convert.ToString(rdr["Password"]);
                    user.UserFullName = Convert.ToString(rdr["UserFullName"]);
                    user.DateOfBirth  = Convert.ToDateTime(rdr["DateOfBirth"]);
                    user.Email        = Convert.ToString(rdr["Email"]);
                    user.PhoneNumber  = Convert.ToString(rdr["PhoneNumber"]);
                    user.AccountType  = Convert.ToInt16(rdr["AccountType"]);
                    user.Rating       = Convert.ToInt16(rdr["Rating"]);

                    return(user);
                }
                return(null);
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                con.Close();
            }
        }
Exemplo n.º 22
0
        public static bool LoginCheck(string username, string password, out UserMasterDto _user)
        {
            UserMasterDto user;
            string        sql = "SELECT *  FROM tblUserMaster WHERE UserName='******' and Password='******';";

            Console.WriteLine(sql);
            SqlConnection con = new SqlConnection(Properties.Settings.Default.BlindEyeDBConStr);
            SqlCommand    cmd = new SqlCommand(sql, con);

            try
            {
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    user = new UserMasterDto();
                    user.UserMasterID = Convert.ToInt64(rdr["UserMasterID"]);

                    user.UserName     = Convert.ToString(rdr["UserName"]);
                    user.Password     = Convert.ToString(rdr["Password"]);
                    user.UserFullName = Convert.ToString(rdr["UserFullName"]);
                    user.DateOfBirth  = Convert.ToDateTime(rdr["DateOfBirth"]);
                    user.Email        = Convert.ToString(rdr["Email"]);
                    user.PhoneNumber  = Convert.ToString(rdr["PhoneNumber"]);
                    user.AccountType  = Convert.ToInt16(rdr["AccountType"]);
                    user.Rating       = Convert.ToInt16(rdr["Rating"]);
                    _user             = new UserMasterDto();
                    _user             = user;
                    return(true);
                }
                _user = new UserMasterDto();
                return(false);
            }
            catch (Exception e)
            {
                _user = new UserMasterDto();
                return(false);
            }
            finally
            {
                con.Close();
            }
        }
Exemplo n.º 23
0
        public void AddUser(UserMasterDto userMasterDto)
        {
            var user = new Finex.Data.UserMaster();

            user.IsActive   = true;
            user.UserName   = userMasterDto.UserName;
            user.UserTypeId = userMasterDto.UserTypeId;
            user.Mobile     = userMasterDto.Mobile;
            user.Name       = userMasterDto.Name;
            user.Email      = userMasterDto.Email;
            user.CreateDate = DateTime.Now;
            user.UpdateDate = DateTime.Now;
            var passwordList = new List <Finex.Data.Password>();
            var password     = new Finex.Data.Password();

            password.Password1 = Encryption.Encrypt(userMasterDto.PasswordsDto.Password, true);
            passwordList.Add(password);
            user.Passwords = passwordList;
            _unitOfWork.UserMasterRepository.Insert(user);
            _unitOfWork.Save();
        }
        public async Task <int> AddNewUserAsync(UserMasterDto userDto)
        {
            var user   = _mapper.Map <UserMasterDto, UserMaster>(userDto);
            var userId = await _userRepository.AddNewUserAsync(user);

            UserRoles role = new UserRoles
            {
                UserId   = userId,
                RoleId   = userDto.RoleId,
                IsActive = true
            };
            await _userRepository.AssignRoleToUser(role);

            if (userId > 0)
            {
                if (!SaveOtp(user.Id, out var uniqueString))
                {
                    return(0);
                }
                await _emailService.PrepareAndSendEmailAsync(userDto, uniqueString, AspectEnums.TemplateType.Register, null);
            }
            return(userId);
        }
Exemplo n.º 25
0
        public long UpdateUser(AddUser model)
        {
            UserMasterDto userMasterDto = new UserMasterDto();

            try
            {
                if (model != null)
                {
                    userMasterDto.UserId   = model.UserId;
                    userMasterDto.RoleId   = model.RoleId;
                    userMasterDto.Name     = model.Name;
                    userMasterDto.Address  = model.Address;
                    userMasterDto.MobileNo = model.MobileNo;
                    userMasterDto.EmailId  = model.EmailId;
                    userMasterDto.IsActive = true;
                    return(_userAdapter.UpdateUser(userMasterDto));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(-1);
        }
Exemplo n.º 26
0
 public long DeleteUser(UserMasterDto model)
 {
     return(_userAdapter.UpdateUserActiveStatus(model));
     // return _userAdapter.DeleteUser(model);
 }
Exemplo n.º 27
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtPassword.Text == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtPassword.Text == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }


            bool          IsValid = false;
            UserMasterDto user    = new UserMasterDto();

            IsValid = UserMasterDao.LoginCheck(txtUserName.Text.Trim(), txtPassword.Text, out user);



            if (IsValid)
            {
                MDIParent mdi = new MDIParent(user);
                mdi.IsMdiContainer = true;
                mdi.Show();
                mdi.BringToFront();
                this.Hide();
            }



            //if (txtUserName.Text == "user name")
            //{
            //    MessageBox.Show("Please intput your user name.", "User Name is required", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            //    txtUserName.Focus();
            //}
            //else if (txtPassword.Text == "password")
            //{
            //    MessageBox.Show("Please intput your password.", "Password is required", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            //    txtPassword.Focus();
            //}
            //else
            //{
            //    USER_MASTER _user = new USER_MASTER();
            //    try
            //    {
            //        using (BaseManager manager = new BaseManager())
            //        {
            //            _user = manager.GetManagerInstance<UserManager>().GetUserByNameORPassword(txtUserName.Text.Trim(), txtPassword.Text.Trim());
            //        }
            //        if (_user != null)
            //        {
            //            frmMDIParent _parent = new frmMDIParent(_user.USERNAME, _user.USERFULLNAME);
            //            _parent.Show();
            //            _parent.BringToFront();
            //            this.Hide();


            //        }
            //        else
            //        {
            //            MessageBox.Show("Login ID/Password is incorrect", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            //        }



            //    }
            //    catch (Exception ex)
            //    {
            //        MessageBox.Show("Error: " + ex.Message, "Fatal Error Occured!!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    }

            //}
        }
Exemplo n.º 28
0
        public ActionResult SaveUser(UserMasterDto userMasterDto)
        {
            _iUserHelper.AddUser(userMasterDto);

            return(RedirectToAction("GetUsers"));
        }
 public async Task UpdateUserAsync(UserMasterDto userDto)
 {
     var user = _mapper.Map <UserMasterDto, UserMaster>(userDto);
     await _userRepository.UpdateUserAsync(user);
 }
Exemplo n.º 30
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (cmbAcctType.SelectedValue == "-1")
            {
                MessageBox.Show(Constant.NOTIFICATION_MESSEGE_COMBOBOX_SELECTION, Constant.NOTIFICATION_CAPTION_COMBOBOX_SELECTION, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtUserFullName.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtPhoneNumber.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (textUserName.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtPassword.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtPhoneNumber.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (txtEmail.Text.Trim() == string.Empty)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            if (dtpDateOfBirth.Value == DateTime.Now)
            {
                MessageBox.Show(Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, Constant.NOTIFICATIO_VALIDATION_ALL_FIELD_IS_REQUIRED, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }


            //rest all validation


            UserMasterDto user = new UserMasterDto();

            user.UserName     = textUserName.Text.Trim();
            user.Password     = txtPassword.Text;
            user.UserFullName = txtUserFullName.Text;
            user.DateOfBirth  = dtpDateOfBirth.Value;
            user.Email        = txtEmail.Text;
            user.PhoneNumber  = txtPhoneNumber.Text;
            user.AccountType  = Convert.ToInt16(cmbAcctType.SelectedValue.ToString());
            user.Rating       = 0;

            if (_UserMasterID > 0)
            {
                user.UserMasterID = _UserMasterID;

                if (UserMasterDao.Update(user))
                {
                    MessageBox.Show(Constant.NOTIFICATION_SUCCESS_DATA_SAVING, Constant.NOTIFICATION_CAPTION_SAVE, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Initiate();
                }
                else
                {
                    MessageBox.Show(Constant.DBErrorMsg, Constant.NOTIFICATION_ERROR_DATA_SAVING, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                if (UserMasterDao.Insert(user))
                {
                    MessageBox.Show(Constant.NOTIFICATION_SUCCESS_DATA_SAVING, Constant.NOTIFICATION_CAPTION_SAVE, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    Initiate();
                }
                else
                {
                    MessageBox.Show(Constant.DBErrorMsg, Constant.NOTIFICATION_ERROR_DATA_SAVING, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }