protected void btnSave_Click(object sender, EventArgs e) { DataTable dt = empf.CheckUser(txtUsername.Text); if (txtPassword.Text == txtRePassword.Text) { if (dt.Rows.Count == 0) { int i = empf.CreateUser(ddlTitle.Text, Convert.ToInt32(txtEmployeeNo.Text), txtFirstName.Text, txtLastName.Text, radGender.Text, ddlCountry.Text, ddlCity.Text, txtPost.Text, txtTemporary.Text, txtPermanent.Text, Convert.ToDateTime(txtDateOfJoining.Text), Convert.ToDateTime(txtDateOfBirth.Text), txtTelephone.Text, txtMobile.Text, txtEmail.Text, Convert.ToDecimal(txtBasicSalary.Text), ddlContractPeriod.Text, ddlContractType.Text, chkAllpwBonus.Checked ? true : false, chkOt.Checked ? true : false, FileUpload1.FileName, chkIsActive.Checked ? true : false, txtUsername.Text, txtPassword.Text, txtRePassword.Text, ddlUsertype.Text); if (i > 0) { FileUpload1.SaveAs(Server.MapPath("../Gallery/" + FileUpload1.FileName)); al.callAlert("success", "User", "Employee Created"); ClearGrid(); } } else if (dt.Rows.Count > 0) { al.callAlert("error", "FAIL", "User already exists"); } } else if (txtPassword.Text != txtRePassword.Text) { al.callAlert("warning", "FAIL", "Password Donot Match"); } }