private void btnSave_Click(object sender, EventArgs e) { UtilityLibrary oUtility = new UtilityLibrary(); if (!SSCRM.App_Code.UtilityLibrary.CustomValidate(grouper1, toolTip1)) { return; } int year = Convert.ToInt32(Convert.ToDateTime(CommonData.CurrentDate).Year) - Convert.ToInt32(Convert.ToDateTime(dtpDOB.Value).Year); if (year < 18) { MessageBox.Show("Dateof birth bellow 18 years not accepted.", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (gvCheckRecords.Rows.Count == 0) { DialogResult dlgResult = MessageBox.Show("Do you want enter application?", "Confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dlgResult == DialogResult.Yes) { frmApplication frmchld = new frmApplication(txtName.Text, txtFName.Text, dtpDOB.Value, txtSSCNo.Text.Replace(" ", ""), sType);//, txtRecruited.Text, txtTrained.Text, dtFrmDt.Value, dtToDt.Value); frmchld.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; frmchld.MdiParent = MdiParent; frmchld.Show(); this.Close(); } } else { MessageBox.Show("Data Matched with others", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEdit_Click(object sender, EventArgs e) { if (!SSCRM.App_Code.UtilityLibrary.CustomValidate(grouper1, toolTip1)) { return; } if (dt.Rows.Count == 1) { //frmApplication frmApplication = new frmApplication(dt.Rows[0]["HAMH_COMPANY_CODE"].ToString(), dt.Rows[0]["HAMH_BRANCH_CODE"].ToString(), dt.Rows[0]["HAMH_APPL_NUMBER"].ToString(), dt.Rows[0]["HAMH_EORA_TYPE"].ToString()); frmApplication frmApplication = new frmApplication(dt.Rows[0]["HAMH_COMPANY_CODE"].ToString(), dt.Rows[0]["HAMH_BRANCH_CODE"].ToString(), dt.Rows[0]["HAMH_APPL_NUMBER"].ToString(), "Edit"); frmApplication.Show(); this.Close(); } }
private void gvPendingData_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { if (gvPendingData.Rows[e.RowIndex].Cells["Edit"].Value.ToString().Trim() != "") { if (Convert.ToBoolean(gvPendingData.Rows[e.RowIndex].Cells["Edit"].Selected) == true) { string CompanyCode = gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["HAMH_COMPANY_CODE"].Index].Value.ToString(); string BranchCode = gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["HAMH_BRANCH_CODE"].Index].Value.ToString(); string ApplNo = gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["HAMH_APPL_NUMBER"].Index].Value.ToString(); frmApplication frmAppli = new frmApplication(CompanyCode, BranchCode, ApplNo.ToString(), "Approved"); //this.Hide(); frmAppli.ShowDialog(); } } if (e.ColumnIndex == gvPendingData.Columns["lnkReason"].Index) { string CompanyCode = gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["HAMH_COMPANY_CODE"].Index].Value.ToString(); string BranchCode = gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["HAMH_BRANCH_CODE"].Index].Value.ToString(); string ApplNo = gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["HAMH_APPL_NUMBER"].Index].Value.ToString(); frmReason frmChldReason = new frmReason(CompanyCode, BranchCode, Convert.ToInt32(ApplNo)); frmChldReason.objApprovedStatus = this; frmChldReason.ShowDialog(); } if (e.ColumnIndex == gvPendingData.Columns["chkApproved"].Index) { bool isExist = true; bool cbchecked = (bool)gvPendingData.Rows[e.RowIndex].Cells["chkApproved"].EditedFormattedValue; if (cbchecked == false) { objSQLDB = new SQLDB(); Int32 count = 1;//Convert.ToInt32(objSQLDB.ExecuteDataSet("SELECT COUNT(*) FROM HR_APPL_APPROVAL_DETL WHERE HAAD_APPL_NUMBER = '" + gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["HAMH_APPL_NUMBER"].Index].Value.ToString() + "'").Tables[0].Rows[0][0].ToString()); if (count == 0) { //gvPendingData.Rows[e.RowIndex].Cells["chkApproved"].Value = true; //((DataGridView)sender)[gvPendingData.Columns["chkApproved"].Index, e.RowIndex].Value = false; //CheckBox cb = (CheckBox)((DataGridView)sender)[gvPendingData.Columns["chkApproved"].Index, e.RowIndex].Value; //cb = new CheckBox(); //cb.Checked = false; //MessageBox.Show("Incomplete Data For Agent : " + gvPendingData.Rows[e.RowIndex].Cells["HAMH_EORA_CODE"].Value, "SSCRM", MessageBoxButtons.OK, MessageBoxIcon.Warning); //DataGridViewCheckBoxCell Check = (DataGridViewCheckBoxCell)gvPendingData.Rows[e.RowIndex].Cells["chkApproved"]; isExist = false; //gvPendingData.Rows[e.RowIndex].Cells["aFlag"].Value = "YES"; //GetPendingData(); } //if (count != 0) // count = Convert.ToInt32(objSQLDB.ExecuteDataSet("SELECT COUNT(*) FROM HR_APPL_EDU_DETL WHERE HAED_APPL_NUMBER = '" + gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["HAMH_APPL_NUMBER"].Index].Value.ToString() + "'").Tables[0].Rows[0][0].ToString()); //if (count == 0) //{ // //gvPendingData.Rows[e.RowIndex].Cells["chkApproved"].Value = true; // //((DataGridView)sender)[gvPendingData.Columns["chkApproved"].Index, e.RowIndex].Value = false; // //CheckBox cb = (CheckBox)((DataGridView)sender)[gvPendingData.Columns["chkApproved"].Index, e.RowIndex].Value; // //cb = new CheckBox(); // //cb.Checked = false; // //MessageBox.Show("Incomplete Data For Agent : " + gvPendingData.Rows[e.RowIndex].Cells["HAMH_EORA_CODE"].Value, "SSCRM", MessageBoxButtons.OK, MessageBoxIcon.Warning); // DataGridViewCheckBoxCell Check = (DataGridViewCheckBoxCell)gvPendingData.Rows[e.RowIndex].Cells["chkApproved"]; // Check.Selected = false; // isExist = false; // //gvPendingData.Rows[e.RowIndex].Cells["aFlag"].Value = "YES"; // //GetPendingData(); //} if (gvPendingData.Rows[e.RowIndex].Cells[gvPendingData.Columns["Qualfication"].Index].Value.ToString().Trim() == "") { isExist = false; //MessageBox.Show("Enter Qualification For Agent : " + gvPendingData.Rows[e.RowIndex].Cells["HAMH_EORA_CODE"].Value, "SSCRM", MessageBoxButtons.OK, MessageBoxIcon.Warning); gvPendingData.Rows[e.RowIndex].Cells["aFlag"].Value = "YES"; } if (isExist == false) { MessageBox.Show("Incomplete Data For Agent : " + gvPendingData.Rows[e.RowIndex].Cells["HAMH_EORA_CODE"].Value, "SSCRM", MessageBoxButtons.OK, MessageBoxIcon.Warning); gvPendingData.Rows[e.RowIndex].Cells["aFlag"].Value = "YES"; } else { gvPendingData.Rows[e.RowIndex].Cells["aFlag"].Value = "NO"; } } } } }