protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         userObj = new clsUserDetails();
         ut      = new Utility();
         //Encryption.Encrypt(txtPassword.Text.Trim(), clsConstant.INITVECTOR);
         //string encryptedValue = SimpleHash.HMACSha1(txtPassword.Text, clsConstant.INITVECTOR);
         //string encryptedValue = md5.CalculateMD5Hash(txtPassword.Text);
         string encryptedValue = txtPassword.Text;
         if (!userObj.UserNameExist(txtUserName.Text))
         {
             userObj.AddUserDetails(Convert.ToInt32(drpAgencyName.SelectedValue), txtFirstName.Text, txtLastName.Text,
                                    txtUserName.Text, encryptedValue.ToUpper(), txtTelephone.Text, txtCellPhone.Text, txtEmail.Text,
                                    Convert.ToInt32(drpParentUser.SelectedValue), txtSkypeID.Text, Convert.ToInt32(drpDesignation.SelectedValue),
                                    chkUserActive.Checked ? 1 : 0, Convert.ToInt32(drpSuperUser.SelectedValue),
                                    ddlsts.SelectedValue.ToString(), chkTTL.Checked ? "true" : "false"
                                    );
             lblUserExist.Text      = "Information Successfully saved";
             lblUserExist.ForeColor = Color.Black;
             ut.ResetFormControl(reSetDiv);
         }
         else
         {
             lblUserExist.Text      = "User name already exist";
             lblUserExist.ForeColor = Color.Red;
             txtUserName.Focus();
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
 protected void txtUserName_TextChanged(object sender, EventArgs e)
 {
     userObj = new clsUserDetails();
     ut      = new Utility();
     if (userObj.UserNameExist(txtUserName.Text))
     {
         lblUserExist.Text      = "User name already exist";
         lblUserExist.ForeColor = Color.Red;
         txtUserName.Focus();
     }
 }