private void cbCompany_SelectedIndexChanged(object sender, EventArgs e) { if (cbCompany.SelectedIndex > 0) { //if (CommonData.LogUserId.ToUpper() != "ADMIN") //{ objHrInfo = new HRInfo(); DataTable dtBranch = objHrInfo.GetUserBranchList(CommonData.LogUserId, cbCompany.SelectedValue.ToString(), "BR", "").Tables[0]; UtilityLibrary.PopulateControl(cbUserBranch, dtBranch.DefaultView, 1, 0, "--PLEASE SELECT--", 0); objHrInfo = null; //} //else //{ // objHrInfo = new HRInfo(); // DataTable dtBranch = objHrInfo.GetAllBranchList(cbCompany.SelectedValue.ToString(), "BR", "").Tables[0]; // UtilityLibrary.PopulateControl(cbUserBranch, dtBranch.DefaultView, 1, 0, "--PLEASE SELECT--", 0); // objHrInfo = null; //} } else { cbUserBranch.Items.Clear(); } FillDataToGrid(); }
private void btnReport_Click(object sender, EventArgs e) { if (txtEcodeSearch.Text != "") { oHRInfo = new HRInfo(); Reports.Employee.DSEmployee oDSEmployee = new SSCRM.Reports.Employee.DSEmployee(); DataSet ds = oHRInfo.GetEoraCode(Convert.ToInt32(txtEcodeSearch.Text)); CommonData.ViewReport = "SSHR_HRINFORMATION"; oDSEmployee.MainHead1.Merge(ds.Tables[0]); oDSEmployee.Education.Merge(ds.Tables[1]); oDSEmployee.ShortCourse.Merge(ds.Tables[2]); oDSEmployee.Curricular.Merge(ds.Tables[3]); oDSEmployee.Family.Merge(ds.Tables[4]); oDSEmployee.Reference.Merge(ds.Tables[5]); oDSEmployee.Experience.Merge(ds.Tables[6]); oDSEmployee.Documents.Merge(ds.Tables[8]); oDSEmployee.Induction.Merge(ds.Tables[9]); oDSEmployee.EORA.Merge(ds.Tables[10]); DataTable dtD = new DataTable(); dtD.Columns.Add("CM_COMPANY_NAME"); dtD.Columns.Add("BRANCH_NAME"); if (ds.Tables[11].Rows.Count > 0) { dtD.Rows.Add(new Object[] { ds.Tables[11].Rows[0]["CM_COMPANY_NAME"], ds.Tables[11].Rows[0]["BRANCH_NAME"] }); } oDSEmployee.MainHead11.Merge(dtD); ReportViewer chldRV = new ReportViewer(oDSEmployee); chldRV.Show(); } }
private void FillEmployeeData() { objHRdb = new HRInfo(); DataTable dt = new DataTable(); cbEmployees.DataBindings.Clear(); try { dt = objHRdb.GetEmployeesForMisconduct(stCompCode, stBranCode, stDocMonth, txtEnameSearch.Text.ToString()).Tables[0]; if (dt.Rows.Count > 0) { DataRow dr = dt.NewRow(); //dr[1] = "--Select--"; //dr[3] = "--Select--"; //dt.Rows.InsertAt(dr, 0); cbEmployees.DataSource = dt; cbEmployees.DisplayMember = "ENAME"; cbEmployees.ValueMember = "EmpDetl"; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHRdb = null; dt = null; } }
private int UpdatePhoto() { objSQLDB = new SQLDB(); objHrInfo = new HRInfo(); DataTable dt = new DataTable(); int iEcode = 0; try { dt = objSQLDB.ExecuteDataSet("SELECT top 1 HAMH_APPL_NUMBER,HAMH_EORA_CODE FROM temp_hr_photo_upload21112013 " + "INNER JOIN HR_APPL_MASTER_HEAD ON HAMH_EORA_CODE = ecode " + "where HAMH_MY_PHOTO is null").Tables[0]; int iApplNo = Convert.ToInt32(dt.Rows[0]["HAMH_APPL_NUMBER"].ToString()); iEcode = Convert.ToInt32(dt.Rows[0]["HAMH_EORA_CODE"].ToString()); Image loadedImage = Image.FromFile("D:\\Scan Photos\\" + iEcode + ".jpg"); byte[] imageData = { 0 }; imageData = ReadFile("D:\\Scan Photos\\" + iEcode + ".jpg"); objHrInfo.UpdatePhoto(iApplNo, imageData); } catch (Exception ex) { objSQLDB.ExecuteSaveData("DELETE FROM temp_hr_photo_upload21112013 WHERE ecode = " + iEcode); } objHrInfo = null; dt = null; return(iEcode); }
private void gvMultiple_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { if (e.ColumnIndex == gvMultiple.Columns["Delete"].Index) { string Status = gvMultiple.Rows[e.RowIndex].Cells[gvMultiple.Columns["STATUS"].Index].Value.ToString(); if (Status == "WORKING" && CommonData.LogUserId.ToUpper() != "ADMIN") { MessageBox.Show("This record cannot deleted.", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { //DialogResult dlgResult = MessageBox.Show("Do you want delete this record?", "Confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); //if (dlgResult == DialogResult.Yes) { string sEcode = gvMultiple.Rows[e.RowIndex].Cells[gvMultiple.Columns["HAMH_EORA_CODE"].Index].Value.ToString(); string sApplNo = gvMultiple.Rows[e.RowIndex].Cells[gvMultiple.Columns["HAMH_APPL_NUMBER"].Index].Value.ToString(); objHRInfo = new HRInfo(); int isqlqry = objHRInfo.DelDuplicatRecords(Convert.ToInt32(sApplNo), Convert.ToInt32(sEcode), 102); objHRInfo = null; if (isqlqry > 0) { //MessageBox.Show("Selected information Has Been Deleted", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Selected information not Deleted", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information); } GetDatatoGrid(); } } } } }
public void GetPopupContrpls() { objHRInfo = new HRInfo(); DataTable dtBranch = objHRInfo.GetAllBranchList(CommonData.CompanyCode, "BR", "").Tables[0]; UtilityLibrary.PopulateControl(cmbBranch, dtBranch.DefaultView, 1, 0, "--PLEASE SELECT--", 0); objHRInfo = null; }
private void FillSalStructureDeatailsTogrid() { objHRinfo = new HRInfo(); DataTable dt = new DataTable(); dgvSaltructDetails.Rows.Clear(); if (cbSalStructType.SelectedIndex > 0) { try { dt = objHRinfo.Get_SalaryStructureDetails(cbSalStructType.Tag.ToString()).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { dgvSaltructDetails.Rows.Add(); dgvSaltructDetails.Rows[i].Cells["SLNO"].Value = (i + 1).ToString(); dgvSaltructDetails.Rows[i].Cells["SalStruType"].Value = dt.Rows[i]["SalStruType"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalStruCode"].Value = dt.Rows[i]["SalStruCode"].ToString(); dgvSaltructDetails.Rows[i].Cells["DesigCode"].Value = dt.Rows[i]["DesigCode"].ToString(); dgvSaltructDetails.Rows[i].Cells["DesignName"].Value = dt.Rows[i]["DesignName"].ToString(); dgvSaltructDetails.Rows[i].Cells["EffectFrom"].Value = Convert.ToDateTime(dt.Rows[i]["EffectFrom"].ToString()).ToShortDateString(); dgvSaltructDetails.Rows[i].Cells["EffectTo"].Value = dt.Rows[i]["EffectTo"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalStatus"].Value = dt.Rows[i]["SalStatus"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalBasic"].Value = dt.Rows[i]["SalBasic"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalHra"].Value = dt.Rows[i]["SalHra"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalCca"].Value = dt.Rows[i]["SalCca"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalConvAlw"].Value = dt.Rows[i]["SalConvAlw"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalLTAAlw"].Value = dt.Rows[i]["SalLTAAlw"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalSpecialAlw"].Value = dt.Rows[i]["SalSpecialAlw"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalUnfAlw"].Value = dt.Rows[i]["SalUnfAlw"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalvehicleAlw"].Value = dt.Rows[i]["SalvehicleAlw"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalChildAlw"].Value = dt.Rows[i]["SalChildAlw"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalBnpAlw"].Value = dt.Rows[i]["SalBnpAlw"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalMedReimb"].Value = dt.Rows[i]["SalMedReimb"].ToString(); dgvSaltructDetails.Rows[i].Cells["SalpET"].Value = dt.Rows[i]["SalpET"].ToString(); dgvSaltructDetails.Rows[i].Cells["Gross"].Value = dt.Rows[i]["SalGross"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHRinfo = null; dt = null; } } }
private void cbCompany_SelectedIndexChanged(object sender, EventArgs e) { if (cbCompany.SelectedIndex > 0) { objHRInfo = new HRInfo(); UtilityLibrary.PopulateControl(cbBranch, objHRInfo.GetAllBranchList(cbCompany.SelectedValue.ToString(), "BR", "").Tables[0].DefaultView, 1, 0, "-- Please Select --", 0); objHRInfo = null; } }
private void cmbCompany_SelectedIndexChanged(object sender, EventArgs e) { if (cmbCompany.SelectedIndex > 0) { objHrInfo = new HRInfo(); DataTable dtBranch = objHrInfo.GetAllBranchList(cmbCompany.SelectedValue.ToString(), "BR", "").Tables[0]; UtilityLibrary.PopulateControl(cmbBranch, dtBranch.DefaultView, 1, 0, "--PLEASE SELECT--", 0); objHrInfo = null; } }
private void btnDisplayPromotionDetails_Click(object sender, EventArgs e) { objHRdb = new HRInfo(); DataTable dt = new DataTable(); gvEmpPromotionDetails.Rows.Clear(); if (CheckData() == true) { try { if (cbFilterType.SelectedIndex == 1) { string CompCode = cbCompany.SelectedValue.ToString(); string BranCode = cbBranches.SelectedValue.ToString(); DateTime FromDate = dtpFrmDate.Value; DateTime ToDate = dtpToDate.Value; dt = objHRdb.GetPromotionDetlByDate(CompCode, BranCode, FromDate, ToDate).Tables[0]; } else { dt = objHRdb.GetPromotionDetlByEcode(Convert.ToInt32(txtEcodeSearch.Text)).Tables[0]; } if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { gvEmpPromotionDetails.Rows.Add(); gvEmpPromotionDetails.Rows[i].Cells["SLNO"].Value = (i + 1).ToString(); gvEmpPromotionDetails.Rows[i].Cells["PromotionCode"].Value = dt.Rows[i]["PromotionCode"].ToString(); gvEmpPromotionDetails.Rows[i].Cells["ApplNo"].Value = dt.Rows[i]["ApplNo"].ToString(); gvEmpPromotionDetails.Rows[i].Cells["Ecode"].Value = dt.Rows[i]["Ecode"].ToString(); gvEmpPromotionDetails.Rows[i].Cells["EmpName"].Value = dt.Rows[i]["EmpName"].ToString(); gvEmpPromotionDetails.Rows[i].Cells["DeptName"].Value = dt.Rows[i]["DeptName"].ToString(); gvEmpPromotionDetails.Rows[i].Cells["LetterType"].Value = dt.Rows[i]["PromotionName"].ToString(); gvEmpPromotionDetails.Rows[i].Cells["LetterRefNo"].Value = dt.Rows[i]["LetterRefNo"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objSQLdb = null; dt = null; } } }
private void cbCompany_SelectedIndexChanged(object sender, EventArgs e) { if (cbCompany.SelectedIndex > 0) { objHRInfo = new HRInfo(); UtilityLibrary.PopulateControl(cbBranch, objHRInfo.GetAllBranchList(cbCompany.SelectedValue.ToString(), "BR", "").Tables[0].DefaultView, 1, 0, "--Please Select--", 0); objHRInfo = null; objSQLDB = new SQLDB(); string sqlQry = "SELECT PM_PRODUCT_ID,PM_PRODUCT_NAME from dbo.PRODUCT_MAS a inner join product_mas_company b on a.pm_product_id=b.pmc_product_id where pmc_product_company='" + cbCompany.SelectedValue.ToString() + "'"; UtilityLibrary.PopulateControl(cmbProducts, objSQLDB.ExecuteDataSet(sqlQry).Tables[0].DefaultView, 1, 0, "-- Please Select --", 0); objSQLDB = null; } }
public void TextAuto() { objHrInfo = new HRInfo(); DataTable dt = objHrInfo.GetNameandEcode().Tables[0]; objHrInfo = null; AutoCompleteStringCollection local = new AutoCompleteStringCollection(); for (int i = 0; i < dt.Rows.Count; i++) { local.Add(dt.Rows[i]["Data"].ToString()); } txtReportto.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtReportto.AutoCompleteSource = AutoCompleteSource.CustomSource; txtReportto.AutoCompleteCustomSource = local; }
private void cmbCompany_SelectedIndexChanged(object sender, EventArgs e) { if (cmbCompany.SelectedIndex > 0) { objDB = new SQLDB(); objHrInfo = new HRInfo(); //DataTable dtBranch = objHrInfo.GetAllBranchList(cmbCompany.SelectedValue.ToString(), "", "").Tables[0]; DataTable dtBranch = objDB.ExecuteDataSet("SELECT branch_code as branch_code, branch_name as branch_name,branch_Type,ACTIVE FROM branch_mas " + "WHERE branch_name<>'''' AND upper(company_code)=Upper('" + cmbCompany.SelectedValue.ToString() + "') Order by branch_name").Tables[0]; UtilityLibrary.PopulateControl(cmbBranch, dtBranch.DefaultView, 1, 0, "--PLEASE SELECT--", 0); objHrInfo = null; txtRefNo.Text = GenNewRefNo(CommonData.CompanyCode, CommonData.BranchCode, CommonData.FinancialYear, cmbPBType.SelectedValue.ToString()); } }
public void GetDatatoGrid() { objHRInfo = new HRInfo(); DataSet ds = objHRInfo.GetDuplicatRecords(); objHRInfo = null; DataTable dt = ds.Tables[0]; int intRow = 1; gvMultiple.Rows.Clear(); for (int i = 0; i < dt.Rows.Count; i++) { DataGridViewRow tempRow = new DataGridViewRow(); DataGridViewCell cellSLNO = new DataGridViewTextBoxCell(); cellSLNO.Value = intRow; tempRow.Cells.Add(cellSLNO); DataGridViewCell cellAppNo = new DataGridViewTextBoxCell(); cellAppNo.Value = dt.Rows[i]["HAMH_APPL_NUMBER"]; tempRow.Cells.Add(cellAppNo); DataGridViewCell celleCode = new DataGridViewTextBoxCell(); celleCode.Value = dt.Rows[i]["HAMH_EORA_CODE"]; tempRow.Cells.Add(celleCode); DataGridViewCell cellename = new DataGridViewTextBoxCell(); cellename.Value = dt.Rows[i]["HAMH_NAME"]; tempRow.Cells.Add(cellename); DataGridViewCell cellFname = new DataGridViewTextBoxCell(); cellFname.Value = dt.Rows[i]["HAMH_FORH_NAME"]; tempRow.Cells.Add(cellFname); DataGridViewCell cellDOB = new DataGridViewTextBoxCell(); cellDOB.Value = Convert.ToDateTime(dt.Rows[i]["HAMH_DOB"]).ToString("dd/MMM/yyyy");; tempRow.Cells.Add(cellDOB); DataGridViewCell cellDOJ = new DataGridViewTextBoxCell(); cellDOJ.Value = Convert.ToDateTime(dt.Rows[i]["HAMH_DOJ"]).ToString("dd/MMM/yyyy"); tempRow.Cells.Add(cellDOJ); DataGridViewCell cellStatus = new DataGridViewTextBoxCell(); cellStatus.Value = dt.Rows[i]["STATUS"]; tempRow.Cells.Add(cellStatus); intRow = intRow + 1; gvMultiple.Rows.Add(tempRow); } }
private void FillSalesPromotionDeatailsTogrid() { objHRinfo = new HRInfo(); DataTable dt = new DataTable(); gvSalePromotionDetails.Rows.Clear(); if (cbCompany.SelectedIndex > 0) { try { dt = objHRinfo.GetSalesPromotionDetails(cbCompany.SelectedValue.ToString()).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { gvSalePromotionDetails.Rows.Add(); gvSalePromotionDetails.Rows[i].Cells["SLNO"].Value = (i + 1).ToString(); //gvSalePromotionDetails.Rows[i].Cells["PromotionId"].Value = dt.Rows[i]["ID"].ToString(); gvSalePromotionDetails.Rows[i].Cells["DeptId"].Value = dt.Rows[i]["DeptId"].ToString(); gvSalePromotionDetails.Rows[i].Cells["PromotionType"].Value = dt.Rows[i]["PromotionType"].ToString(); gvSalePromotionDetails.Rows[i].Cells["ExcellentMonths"].Value = dt.Rows[i]["ExeMonths"].ToString(); gvSalePromotionDetails.Rows[i].Cells["ExcellentPoints"].Value = dt.Rows[i]["ExePoints"].ToString(); gvSalePromotionDetails.Rows[i].Cells["GoodMonths"].Value = dt.Rows[i]["GoodMonths"].ToString(); gvSalePromotionDetails.Rows[i].Cells["GoodPoints"].Value = dt.Rows[i]["GoodPoints"].ToString(); gvSalePromotionDetails.Rows[i].Cells["AverageMonths"].Value = dt.Rows[i]["AvgMonths"].ToString(); gvSalePromotionDetails.Rows[i].Cells["AveragePoints"].Value = dt.Rows[i]["AvgPoints"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHRinfo = null; dt = null; } } }
public void GetPopup() { string sqlQry = "SELECT LevelsDesig_mas.LDM_DESIG_ID as desig_id, LevelsDesig_mas.ldm_designations, LevelsDesig_mas.ldm_elevel_id as elevel_id " + " FROM [dbo].[LevelsDesig_mas] WHERE dbo.LevelsDesig_mas.ldm_company_code = '" + CommonData.CompanyCode + "' ORDER BY ldm_designations "; objSQLDB = new SQLDB(); dsDesgLvl = objSQLDB.ExecuteDataSet(sqlQry); UtilityLibrary.PopulateControl(cbddlEORADesig, objSQLDB.ExecuteDataSet(sqlQry).Tables[0].DefaultView, 1, 0, "--Please Select--", 0); objSQLDB = null; objHrInfo = new HRInfo(); DataTable dtBranch = objHrInfo.GetAllBranchList(CommonData.CompanyCode, "", "").Tables[0]; UtilityLibrary.PopulateControl(cbddlBranch, dtBranch.DefaultView, 1, 0, "--PLEASE SELECT--", 0); objHrInfo = null; }
private void FillUsers() { objHRdb = new HRInfo(); DataTable dt = new DataTable(); clbUsers.Items.Clear(); if (cbCompany.SelectedIndex > 0 && cbLocation.SelectedIndex > 0) { try { dt = objHRdb.BranchUsersList_Get(cbCompany.SelectedValue.ToString(), cbLocation.SelectedValue.ToString()).Tables[0]; if (dt.Rows.Count > 0) { foreach (DataRow dataRow in dt.Rows) { if (dataRow["UM_USER_ID"] + "" != "") { NewCheckboxListItem oclBox = new NewCheckboxListItem(); oclBox.Tag = dataRow["UM_USER_ID"].ToString(); oclBox.Text = dataRow["UM_USER_NAME"].ToString() + " ( " + dataRow["UM_USER_ID"].ToString() + " )"; clbUsers.Items.Add(oclBox); oclBox = null; } } } else { clbUsers.Items.Clear(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { objHRdb = null; } } else { clbUsers.Items.Clear(); } }
public void FillEmpAuditPlanningDetl() { objHRdb = new HRInfo(); DataTable dt = new DataTable(); gvAuditEmpPlanningDetl.Rows.Clear(); Int32 iEmpEcode = 0; if (cbAuditEmployees.SelectedIndex > -1) { try { if (cbAuditEmployees.SelectedIndex > -1) { iEmpEcode = Convert.ToInt32(((System.Data.DataRowView)(cbAuditEmployees.SelectedItem)).Row.ItemArray[1].ToString().Split('@')[0]); } dt = objHRdb.GetEmpAuditPlanningDetl(iEmpEcode, Convert.ToDateTime(dtpFromdate.Value).ToString("dd/MMM/yyyy"), Convert.ToDateTime(dtpToDate.Value).ToString("dd/MMM/yyyy")).Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { gvAuditEmpPlanningDetl.Rows.Add(); gvAuditEmpPlanningDetl.Rows[i].Cells["SlNO"].Value = (i + 1).ToString(); gvAuditEmpPlanningDetl.Rows[i].Cells["CompCode"].Value = dt.Rows[i]["CompCode"].ToString(); gvAuditEmpPlanningDetl.Rows[i].Cells["LocationCode"].Value = dt.Rows[i]["BranchCode"].ToString(); gvAuditEmpPlanningDetl.Rows[i].Cells["BranchType"].Value = dt.Rows[i]["TrnType"].ToString(); gvAuditEmpPlanningDetl.Rows[i].Cells["Date"].Value = Convert.ToDateTime(dt.Rows[i]["PlanningDate"]).ToString("dd/MMM/yyyy"); gvAuditEmpPlanningDetl.Rows[i].Cells["Location"].Value = dt.Rows[i]["LocationName"].ToString(); gvAuditEmpPlanningDetl.Rows[i].Cells["Remarks"].Value = dt.Rows[i]["Remarks"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHRdb = null; } } }
private void FillTrainingProgramDetl(Int32 iEcode, string sTrainerName) { objHRdb = new HRInfo(); DataTable dt = new DataTable(); gvTrainingPrgDetl.Rows.Clear(); if (cbTrainerNames.SelectedIndex > 0) { try { if (cbPrgType.SelectedIndex == 0) { dt = objHRdb.GetTrainingProgramsByTrainer(iEcode, sTrainerName, Convert.ToDateTime(dtpFromdate.Value).ToString("dd/MMM/yyyy"), Convert.ToDateTime(dtpToDate.Value).ToString("dd/MMM/yyyy"), "ACTUAL").Tables[0]; } else { dt = objHRdb.GetTrainingProgramsByTrainer(iEcode, sTrainerName, Convert.ToDateTime(dtpFromdate.Value).ToString("dd/MMM/yyyy"), Convert.ToDateTime(dtpToDate.Value).ToString("dd/MMM/yyyy"), "PLAN").Tables[0]; } if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { gvTrainingPrgDetl.Rows.Add(); gvTrainingPrgDetl.Rows[i].Cells["SLNO"].Value = (i + 1).ToString(); gvTrainingPrgDetl.Rows[i].Cells["PrgNo"].Value = dt.Rows[i]["PrgNo"].ToString(); gvTrainingPrgDetl.Rows[i].Cells["PrgName"].Value = dt.Rows[i]["PrgName"].ToString(); gvTrainingPrgDetl.Rows[i].Cells["Location"].Value = dt.Rows[i]["Prglocation"].ToString(); gvTrainingPrgDetl.Rows[i].Cells["EmpCnt"].Value = dt.Rows[i]["EmpCnt"].ToString(); gvTrainingPrgDetl.Rows[i].Cells["TopicsCnt"].Value = dt.Rows[i]["TopicsCnt"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }
private void FillTrainingProgramDetl(Int32 iEcode) { objHRdb = new HRInfo(); DataTable dt = new DataTable(); clbPrograms.Items.Clear(); if (cbTrainerNames.SelectedIndex > 0) { try { dt = objHRdb.GetTrainingProgramsByTrainer(iEcode, "", Convert.ToDateTime(dtpFromdate.Value).ToString("dd/MMM/yyyy"), Convert.ToDateTime(dtpToDate.Value).ToString("dd/MMM/yyyy"), "ACTUAL").Tables[0]; if (dt.Rows.Count > 0) { //chkAllPrgs.Visible = true; btnReport.Enabled = true; foreach (DataRow dataRow in dt.Rows) { NewCheckboxListItem oclBox = new NewCheckboxListItem(); oclBox.Text = dataRow["PrgNo"].ToString() + '-' + dataRow["PrgName"].ToString() + '(' + dataRow["Prglocation"].ToString() + ')'; oclBox.Tag = dataRow["PrgNo"].ToString(); clbPrograms.Items.Add(oclBox); oclBox = null; } } else { btnReport.Enabled = false; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }
private void FillEmpPFUANDetailData1() { objHRInfo = new HRInfo(); DataSet ds = new DataSet(); try { ds = objHRInfo.GetEmpPFUANDetailData1(txtEcodeSearch.Text); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHRInfo = null; } if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { flagUdate = true; txtUAN.Text = ds.Tables[0].Rows[0]["HAUM_UAN_NO"].ToString(); if (ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_HNO"].ToString().Length != 0) { dt = ds.Tables[0]; txtEmpHNo.ReadOnly = true; txtEmpLandMark.ReadOnly = true; txtEmpVill.ReadOnly = true; txtEmpMandal.ReadOnly = true; txtEmpDistricit.ReadOnly = true; txtEmpState.ReadOnly = true; txtEmpPin.ReadOnly = true; txtEmpPh.ReadOnly = true; txtEmpHNo.Text = ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_HNO"].ToString(); txtEmpLandMark.Text = ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_LANDMARK"].ToString(); txtEmpVill.Text = ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_VILLAGE"].ToString(); txtEmpMandal.Text = ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_MANDAL"].ToString(); txtEmpDistricit.Text = ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_DISTRICT"].ToString(); txtEmpState.Text = ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_STATE"].ToString(); txtEmpPin.Text = ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_PIN"].ToString(); txtEmpPh.Text = ds.Tables[0].Rows[0]["HAUM_ADDR_PRES_PHNO"].ToString(); } else { txtEmpHNo.ReadOnly = false; txtEmpLandMark.ReadOnly = false; txtEmpVill.ReadOnly = false; txtEmpMandal.ReadOnly = false; txtEmpDistricit.ReadOnly = false; txtEmpState.ReadOnly = false; txtEmpPin.ReadOnly = false; txtEmpPh.ReadOnly = false; } if (ds.Tables[0].Rows[0]["HAUM_SIG1"].ToString() != "") { GetImage((byte[])ds.Tables[0].Rows[0]["HAUM_SIG1"], "SIG1"); } if (ds.Tables[0].Rows[0]["HAUM_SIG2"].ToString() != "") { GetImage((byte[])ds.Tables[0].Rows[0]["HAUM_SIG2"], "SIG2"); } if (ds.Tables[0].Rows[0]["HAUM_SIG3"].ToString() != "") { GetImage((byte[])ds.Tables[0].Rows[0]["HAUM_SIG3"], "SIG3"); } FillEmpPFUANDetailData2(""); } else { //txtUAN.Text = ""; //txtEmpHNo.Text = ""; //txtEmpLandMark.Text = ""; //txtEmpVill.Text = ""; //txtEmpMandal.Text = ""; //txtEmpDistricit.Text = ""; //txtEmpState.Text = ""; //txtEmpPin.Text = ""; //txtEmpPh.Text = ""; txtEmpHNo.ReadOnly = false; txtEmpLandMark.ReadOnly = false; txtEmpVill.ReadOnly = false; txtEmpMandal.ReadOnly = false; txtEmpDistricit.ReadOnly = false; txtEmpState.ReadOnly = false; txtEmpPin.ReadOnly = false; txtEmpPh.ReadOnly = false; } } ds = null; }
private void btnExport_Click(object sender, EventArgs e) { try { string sType = "", sStatus = ""; if (cmbType.SelectedIndex == 1) { sType = "A"; } else if (cmbType.SelectedIndex == 2) { sType = "E"; } if (cmdStatus.SelectedIndex == 1) { sStatus = "P"; } else if (cmdStatus.SelectedIndex == 2) { sStatus = "W"; } else if (cmdStatus.SelectedIndex == 3) { sStatus = "L"; } else if (cmdStatus.SelectedIndex == 4) { sStatus = "R"; } DataTable dt = new DataTable(); try { objHrInfo = new HRInfo(); dt = objHrInfo.HR_EmpViewDetails(cmbCompany.SelectedValue.ToString(), cmbBranch_optional.SelectedValue.ToString(), sType, sStatus).Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHrInfo = null; } //folderBrowserDialog1.ShowDialog(); //string s = folderBrowserDialog1.SelectedPath; Excel.Application oXL = new Excel.Application(); Excel.Workbook theWorkbook = oXL.Workbooks.Add(Excel.XlSheetType.xlWorksheet); Excel.Worksheet worksheet = (Excel.Worksheet)oXL.ActiveSheet; oXL.Visible = true; //Excel.Workbook theWorkbook;// = new Excel.Workbook(); //theWorkbook = oXL.Workbooks.Open("D:\\Template.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", true, false, 0, true, true, true); //Excel.Worksheet worksheet;// = (Microsoft.Office.Interop.Excel.Worksheet)Excel.Sheets;// = new Excel.Worksheet(); //worksheet.Name = "Employees"; //DataRow[] rpt = dtv.Table.Rows;//ACTable.Select("Ticker <> ''", "Ticker ASC"); Excel.Range rg = worksheet.get_Range("A1", "L1"); Excel.Range rgData = worksheet.get_Range("A2", "L" + dt.Rows.Count.ToString()); rgData.Font.Size = 10; rgData.WrapText = true; rgData.VerticalAlignment = Excel.Constants.xlCenter; rgData.Borders.Weight = 2; //rg.Select(); rg.Font.Bold = true; rg.Font.Name = "Arial"; rg.Font.Size = 10; rg.WrapText = true; rg.Font.ColorIndex = 2; // White Color : 2 and Red = 3,30; Green = 10,43; rg.HorizontalAlignment = Excel.Constants.xlCenter; rg.Interior.ColorIndex = 31; rg.Borders.Weight = 2; rg.Borders.LineStyle = Excel.Constants.xlSolid; rg.Cells.RowHeight = 38; rg = worksheet.get_Range("A1", Type.Missing); rg.Cells.ColumnWidth = 5; rg.Cells.Value2 = "Sl.No"; rg = worksheet.get_Range("B1", Type.Missing); rg.Cells.ColumnWidth = 10; rg.Cells.Value2 = "ECODE"; rg = worksheet.get_Range("C1", Type.Missing); rg.Cells.ColumnWidth = 10; rg.Cells.Value2 = "Employee/Agent"; rg = worksheet.get_Range("D1", Type.Missing); rg.Cells.ColumnWidth = 30; rg.Cells.Value2 = "Name"; rg = worksheet.get_Range("E1", Type.Missing); rg.Cells.ColumnWidth = 30; rg.Cells.Value2 = "Father/Husband"; rg = worksheet.get_Range("F1", Type.Missing); rg.Cells.ColumnWidth = 30; rg.Cells.Value2 = "Designation"; rg = worksheet.get_Range("G1", Type.Missing); rg.Cells.ColumnWidth = 30; rg.Cells.Value2 = "Department"; rg = worksheet.get_Range("H1", Type.Missing); rg.Cells.ColumnWidth = 15; rg.Cells.Value2 = "Date of Birth"; rg = worksheet.get_Range("I1", Type.Missing); rg.Cells.ColumnWidth = 15; rg.Cells.Value2 = "Date of Join"; rg = worksheet.get_Range("J1", Type.Missing); rg.Cells.ColumnWidth = 20; rg.Cells.Value2 = "Working Status"; rg = worksheet.get_Range("K1", Type.Missing); rg.Cells.ColumnWidth = 20; rg.Cells.Value2 = "Address"; rg = worksheet.get_Range("L1", Type.Missing); rg.Cells.ColumnWidth = 20; rg.Cells.Value2 = "ContactNo"; int RowCounter = 1; foreach (DataRow dr in dt.Rows) { worksheet.Cells[RowCounter + 1, 1] = RowCounter; worksheet.Cells[RowCounter + 1, 2] = dr["HAMH_EORA_CODE"].ToString(); if (dr["HAMH_EORA_TYPE"].ToString() == "E") { worksheet.Cells[RowCounter + 1, 3] = "EMPLOYEE"; } else { worksheet.Cells[RowCounter + 1, 3] = "AGENT"; } worksheet.Cells[RowCounter + 1, 4] = dr["HAMH_NAME"].ToString(); worksheet.Cells[RowCounter + 1, 5] = dr["HAMH_FORH_NAME"].ToString(); worksheet.Cells[RowCounter + 1, 6] = dr["DESIG"].ToString(); worksheet.Cells[RowCounter + 1, 7] = dr["DEPT_DESC"].ToString(); worksheet.Cells[RowCounter + 1, 8] = Convert.ToDateTime(dr["HAMH_DOB"]).ToString("dd/MMM/yyyy"); worksheet.Cells[RowCounter + 1, 9] = Convert.ToDateTime(dr["HAMH_DOJ"]).ToString("dd/MMM/yyyy"); worksheet.Cells[RowCounter + 1, 10] = dr["Status"].ToString(); worksheet.Cells[RowCounter + 1, 11] = dr["Address"].ToString(); worksheet.Cells[RowCounter + 1, 12] = dr["ContactNO"].ToString(); //worksheet.Cells[RowCounter, 5] = dr["Total"].ToString(); RowCounter++; } //theWorkbook.SaveAs("C:\\temp\\EmployeeDetails.xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing, //false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange,Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); //TextWriter twDesigncs = new StreamWriter(s + "\\EmployeeViewDetails.xlsx"); //twDesigncs.Write(wr.ToString()); //twDesigncs.Close(); //string wr = ""; //try //{ // for (int i = 0; i < dtv.Table.Columns.Count; i++) // { // wr += dtv.Table.Columns[i].ToString().ToUpper() + "\t"; // } // wr += "\n"; // //write rows to excel file // for (int i = 0; i < (dtv.Table.Rows.Count); i++) // { // for (int j = 0; j < dtv.Table.Columns.Count; j++) // { // if (dtv.Table.Rows[i][j] != null) // { // wr += Convert.ToString(dtv.Table.Rows[i][j]) + "\t"; // } // else // { // wr += "\t"; // } // } // //go to next line // wr += "\n"; // } // //close file // TextWriter twDesigncs = new StreamWriter(s + "\\EmployeeViewDetails.xlsx"); // twDesigncs.Write(wr.ToString()); // twDesigncs.Close(); // MessageBox.Show("Exported successfully Path" + s + "\\EmployeeViewDetails.xlsx", "SSCRM", MessageBoxButtons.OK, MessageBoxIcon.Information); //} //catch (Exception ex) //{ // throw ex; //} } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void btnUpdate_Click(object sender, EventArgs e) { objSQLDB = new SQLDB(); int iRetVal = 0; byte[] imageData = { 0 }; int iPin = 0; if (addressPresent.Pin.Length > 0) { iPin = Convert.ToInt32(addressPresent.Pin); } else { iPin = 0; } if (lblPath.Text != "") { imageData = ReadFile(lblPath.Text); } //else // imageData = (byte)pictureBox1.BackgroundImage; //string sConnVal = ConfigurationSettings.AppSettings["DBCon"].ToString(); //objSecurity = new Security(); //SqlConnection CN = new SqlConnection(objSecurity.GetDecodeString(sConnVal)); try { string sqlStr = "UPDATE HR_APPL_MASTER_HEAD SET HAMH_PD_BLOOD_GROUP_CODE='" + cmbBloodGrp_optional.Text + "',HAMH_ADD_PRES_ADDR_HNO='" + addressPresent.HouseNo + "'," + "HAMH_ADD_PRES_ADDR_LANDMARK='" + addressPresent.LandMark + "',HAMH_ADD_PRES_ADDR_VILL_OR_TOWN='" + addressPresent.Village + "',HAMH_ADD_PRES_ADDR_MANDAL='" + addressPresent.Mondal + "'," + "HAMH_ADD_PRES_ADDR_DISTRICT='" + addressPresent.District + "',HAMH_ADD_PRES_ADDR_STATE='" + addressPresent.State + "',HAMH_ADD_PRES_ADDR_PIN=" + iPin + ",HAMH_ADD_PRES_ADDR_PHONE='" + txtMobileNo.Text + "'"; //if (lblPath.Text != "") // sqlStr += ", HAMH_MY_PHOTO='" + (object)imageData + "'"; sqlStr += " WHERE HAMH_EORA_CODE=" + txtEcodeSearch.Text; //SqlCommand SqlCom = new SqlCommand(sqlStr, CN); //if (lblPath.Text.Length > 1) // SqlCom.Parameters.Add(new SqlParameter("@Photo", (object)imageData)); //CN.Open(); iRetVal = objSQLDB.ExecuteSaveData(sqlStr); if (lblPath.Text != "") { objHrInfo = new HRInfo(); objHrInfo.UpdatePhoto(Convert.ToInt32(lblApplNo.Text), imageData); } //CN.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objSQLDB = null; } if (iRetVal > 0) { btnClear_Click(null, null); MessageBox.Show("Selected information Has Been Updated", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Selected information not Updated", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Error); } objSecurity = null; }
public void GetDataBuind() { string sType = "", sStatus = ""; if (cmbType.SelectedIndex == 1) { sType = "A"; } else if (cmbType.SelectedIndex == 2) { sType = "E"; } if (cmdStatus.SelectedIndex == 1) { sStatus = "P"; } else if (cmdStatus.SelectedIndex == 2) { sStatus = "W"; } else if (cmdStatus.SelectedIndex == 3) { sStatus = "L"; } else if (cmdStatus.SelectedIndex == 4) { sStatus = "R"; } else { sStatus = ""; } DataTable dt = new DataTable(); try { objHrInfo = new HRInfo(); dt = objHrInfo.HR_EmpViewDetails(cmbCompany.SelectedValue.ToString(), cmbBranch_optional.SelectedValue.ToString(), sType, sStatus).Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHrInfo = null; } //string sFilter = ""; //if (cmbType.SelectedIndex == 0) // sFilter += " HAMH_EORA_TYPE in('E','A') "; //else if (cmbType.SelectedIndex == 1) // sFilter += " HAMH_EORA_TYPE in('A')"; //else // sFilter += " HAMH_EORA_TYPE in('E')"; //dvlist.RowFilter = sFilter; //DataTable dt = dvlist.ToTable(); int intRow = 1; gvPendingData.Rows.Clear(); lblTotal.Text = "Total Records: " + dt.Rows.Count; try { for (int i = 0; i < dt.Rows.Count; i++) { DataGridViewRow tempRow = new DataGridViewRow(); DataGridViewCell cellSLNO = new DataGridViewTextBoxCell(); cellSLNO.Value = intRow; tempRow.Cells.Add(cellSLNO); DataGridViewCell cellcApplNo = new DataGridViewTextBoxCell(); cellcApplNo.Value = dt.Rows[i]["HAMH_APPL_NUMBER"]; tempRow.Cells.Add(cellcApplNo); DataGridViewCell cellcEoraNo = new DataGridViewTextBoxCell(); cellcEoraNo.Value = dt.Rows[i]["HAMH_EORA_CODE"]; tempRow.Cells.Add(cellcEoraNo); DataGridViewCell cellName = new DataGridViewTextBoxCell(); cellName.Value = dt.Rows[i]["HAMH_NAME"]; tempRow.Cells.Add(cellName); DataGridViewCell cellDoj = new DataGridViewTextBoxCell(); if (dt.Rows[i]["HAMH_DOJ"].ToString() != "") { cellDoj.Value = Convert.ToDateTime(dt.Rows[i]["HAMH_DOJ"]).ToString("dd-MM-yyyy"); } else { cellDoj.Value = ""; } tempRow.Cells.Add(cellDoj); DataGridViewCell cellFName = new DataGridViewTextBoxCell(); cellFName.Value = dt.Rows[i]["HAMH_FORH_NAME"]; tempRow.Cells.Add(cellFName); DataGridViewCell cellDesc = new DataGridViewTextBoxCell(); cellDesc.Value = dt.Rows[i]["DESIG"]; tempRow.Cells.Add(cellDesc); DataGridViewCell cellsDept = new DataGridViewTextBoxCell(); cellsDept.Value = dt.Rows[i]["DEPT_DESC"]; tempRow.Cells.Add(cellsDept); DataGridViewCell cellStatus = new DataGridViewTextBoxCell(); cellStatus.Value = dt.Rows[i]["Status"]; tempRow.Cells.Add(cellStatus); DataGridViewCell cellBCode = new DataGridViewTextBoxCell(); cellBCode.Value = dt.Rows[i]["HAMH_BRANCH_CODE"]; tempRow.Cells.Add(cellBCode); DataGridViewCell cellCCode = new DataGridViewTextBoxCell(); cellCCode.Value = dt.Rows[i]["HAMH_COMPANY_CODE"]; tempRow.Cells.Add(cellCCode); intRow = intRow + 1; gvPendingData.Rows.Add(tempRow); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void FillTrainingTopicDetails() { objHRdb = new HRInfo(); DataTable dt = new DataTable(); sDepartments = ""; string DeptName = ""; string Desig = ""; if (cbTopicName.SelectedIndex > 0) { try { dt = objHRdb.GetTrainingTopicDetails(Convert.ToInt32(cbTopicName.SelectedValue)).Tables[0]; if (dt.Rows.Count > 0) { flagUpdate = true; txtDuration.Text = dt.Rows[0]["TopicDuration"].ToString(); clbDesigs.Items.Clear(); for (int i = 0; i < dt.Rows.Count; i++) { if (sDepartments != dt.Rows[i]["DeptId"].ToString()) { sDepartments = dt.Rows[i]["DeptId"].ToString(); FillDesignationsData(sDepartments); } if (DeptName != dt.Rows[i]["DeptName"].ToString()) { DeptName = dt.Rows[i]["DeptName"].ToString(); for (int j = 0; j < clbDepartments.Items.Count; j++) { if (((NewCheckboxListItem)(clbDepartments.Items[j])).Text.Equals(DeptName)) { clbDepartments.SetSelected(j, true); clbDepartments.SetItemChecked(j, true); } } } } for (int iVar = 0; iVar < dt.Rows.Count; iVar++) { Desig = dt.Rows[iVar]["DesigId"].ToString(); for (int k = 0; k < clbDesigs.Items.Count; k++) { if (((NewCheckboxListItem)(clbDesigs.Items[k])).Tag.Equals(Desig)) { clbDesigs.SetSelected(k, true); clbDesigs.SetItemChecked(k, true); } } } } else { flagUpdate = false; for (int i = 0; i < clbDepartments.Items.Count; i++) { clbDepartments.SetItemCheckState(i, CheckState.Unchecked); } if (clbDesigs.Items.Count > 0) { clbDesigs.Items.Clear(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHRdb = null; dt = null; } } else { flagUpdate = false; for (int i = 0; i < clbDepartments.Items.Count; i++) { clbDepartments.SetItemCheckState(i, CheckState.Unchecked); } clbDesigs.Items.Clear(); } }
private void GetEmpDetails() { objsql = new SQLDB(); objHrinfo = new HRInfo(); DataSet dsPhoto = new DataSet(); DataTable dt = new DataTable(); try { dt = objHrinfo.Get_Adhar_MasterDetails(Convert.ToInt32(txtEcodeSearch.Text.ToString())).Tables[0]; dsPhoto = objsql.ExecuteDataSet("SELECT HAPS_PHOTO_SIG FROM HR_APPL_PHOTO_SIG WHERE HAPS_EORA_CODE = " + txtEcodeSearch.Text); if (dt.Rows.Count > 0) { txtApplNo.Text = dt.Rows[0]["AppNo"].ToString(); txtEName.Text = dt.Rows[0]["EmpName"].ToString(); txtFatherName.Text = dt.Rows[0]["FatherName"].ToString(); txtDob.Text = Convert.ToDateTime(dt.Rows[0]["EmpDob"].ToString()).ToShortDateString(); txtDoj.Text = Convert.ToDateTime(dt.Rows[0]["EmpDoj"].ToString()).ToShortDateString(); if (dt.Rows[0]["Status"].Equals("W")) { txtStatus.Text = "WORKING"; } if (dt.Rows[0]["Status"].Equals("P")) { txtStatus.Text = "PENDING"; } if (dt.Rows[0]["Status"].Equals("L")) { txtStatus.Text = "LEFT"; } txtDept.Text = dt.Rows[0]["EmpDept"].ToString(); txtDesig.Text = dt.Rows[0]["EmpDesig"].ToString(); txtadharNo.Text = dt.Rows[0]["AdharNo"].ToString(); txtPanNo.Text = dt.Rows[0]["PancardNo"].ToString(); txtPassportNo.Text = dt.Rows[0]["PassportNo"].ToString(); txtDrivingLinceNo.Text = dt.Rows[0]["DrivingLinceNO"].ToString(); if (dsPhoto.Tables[0].Rows.Count > 0) { GetImage((byte[])dsPhoto.Tables[0].Rows[0]["HAPS_PHOTO_SIG"]); } else { picEmpPhoto.BackgroundImage = null; } } else { txtEName.Text = ""; txtFatherName.Text = ""; txtDept.Text = ""; txtDesig.Text = ""; txtDob.Text = ""; txtDoj.Text = ""; txtStatus.Text = ""; txtPassportNo.Text = ""; txtDrivingLinceNo.Text = ""; txtadharNo.Text = ""; txtApplNo.Text = ""; txtPanNo.Text = ""; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objsql = null; dt = null; } }
private void btnCollect_Click(object sender, EventArgs e) { DataTable dt = null; objHRdb = new HRInfo(); try { dt = objHRdb.EmployeeDeductionsDetails(dtpMonth.Value.ToString("MMMyyyy").ToUpper()).Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } gvEmpLoanDetails.Rows.Clear(); try { if (dt.Rows.Count > 0) { for (int iVar = 0; iVar < dt.Rows.Count; iVar++) { gvEmpLoanDetails.Rows.Add(); gvEmpLoanDetails.Rows[iVar].Cells["SLNO"].Value = (iVar + 1).ToString(); gvEmpLoanDetails.Rows[iVar].Cells["CompCode"].Value = dt.Rows[iVar]["ld_Comp_Code"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["BranchCode"].Value = dt.Rows[iVar]["ld_Bran_Code"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["Ecode"].Value = dt.Rows[iVar]["ld_eora_code"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["EmpName"].Value = dt.Rows[iVar]["ld_emp_name"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["Desig"].Value = dt.Rows[iVar]["ld_desig_name"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["Department"].Value = dt.Rows[iVar]["ld_dept_name"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["PersonalLoan"].Value = dt.Rows[iVar]["ld_Pers_Loan"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["ComputerLoan"].Value = dt.Rows[iVar]["ld_laptop_Loan"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["VehicleLoan"].Value = dt.Rows[iVar]["ld_veh_loan"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["SalaryAdvance"].Value = dt.Rows[iVar]["ld_sal_Adv"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["Other"].Value = dt.Rows[iVar]["ld_Other_dedu"].ToString(); gvEmpLoanDetails.Rows[iVar].Cells["Total"].Value = dt.Rows[iVar]["ld_tot_dedu"].ToString(); } foreach (DataGridViewRow oItem in gvEmpLoanDetails.Rows) { if (Convert.ToDouble(oItem.Cells["PersonalLoan"].Value.ToString()) == 0) { oItem.Cells["PersonalLoan"].Value = ""; } if (Convert.ToDouble(oItem.Cells["ComputerLoan"].Value.ToString()) == 0) { oItem.Cells["ComputerLoan"].Value = ""; } if (Convert.ToDouble(oItem.Cells["VehicleLoan"].Value.ToString()) == 0) { oItem.Cells["VehicleLoan"].Value = ""; } if (Convert.ToDouble(oItem.Cells["SalaryAdvance"].Value.ToString()) == 0) { oItem.Cells["SalaryAdvance"].Value = ""; } if (Convert.ToDouble(oItem.Cells["Other"].Value.ToString()) == 0) { oItem.Cells["Other"].Value = ""; } if (Convert.ToDouble(oItem.Cells["Total"].Value.ToString()) == 0) { oItem.Cells["Total"].Value = ""; } } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } calculateTotal(); }
private void FillEmpPFUANDetailData2(string sDoc) { if (txtEcodeSearch.Text.ToString().Length > 0) { objHRInfo = new HRInfo(); DataSet ds = null; try { ds = objHRInfo.GetEmpPFUANDetailData2(txtEcodeSearch.Text, sDoc); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHRInfo = null; } if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { flagUpdate1 = true; if (CommonData.LogUserId.ToUpper() != "ADMIN" && flagUpdate1 == true) { btnSave.Enabled = false; } else { btnSave.Enabled = true; } cbTypeOfDoc.Text = ds.Tables[0].Rows[0]["HAUMD_DOC_TYPE"].ToString(); txtDocNumber.Text = ds.Tables[0].Rows[0]["HAUMD_DOC_NO"].ToString(); txtNameAsPerDoc.Text = ds.Tables[0].Rows[0]["HAUMD_NAME_AS_DOC"].ToString(); txtFatherAsDoc.Text = ds.Tables[0].Rows[0]["HAUMD_FATHER_NAME"].ToString(); if (ds.Tables[0].Rows[0]["HAUMD_DOB"].ToString().Length > 0) { dtpDOBDate.Value = Convert.ToDateTime(ds.Tables[0].Rows[0]["HAUMD_DOB"].ToString()); } if (cbTypeOfDoc.Text == "BANK ACCOUNT NUMBER") { txtBankAccIFSC.Text = ds.Tables[0].Rows[0]["HAUMD_BANK_ACC_IFSC"].ToString(); } if (cbTypeOfDoc.Text == "DRIVING LICENSE" || cbTypeOfDoc.Text == "PASSPORT") { dtpExpDate.Value = Convert.ToDateTime(ds.Tables[0].Rows[0]["HAUMD_LICENCE_EXP"].ToString()); } if (ds.Tables[0].Rows[0]["HAUMD_DOC_IMG"].ToString() != "") { GetImage((byte[])ds.Tables[0].Rows[0]["HAUMD_DOC_IMG"], "DOC"); } } else { flagUpdate1 = false; btnSave.Enabled = true; txtDocNumber.Text = ""; txtNameAsPerDoc.Text = ""; txtFatherAsDoc.Text = ""; txtBankAccIFSC.Text = ""; picDoc.BackgroundImage = null; picDoc.Image = null; } } ds = null; } }
private void btnAppointment_Click(object sender, EventArgs e) { objSQLDB = new SQLDB(); objHrInfo = new HRInfo(); try { string sRet = ""; string sAppint = "SELECT COUNT(*) FROM dbo.HR_APPL_APPOINTMENT A INNER JOIN HR_APPL_MASTER_HEAD B ON A.HRAP_APPL_NUMBER=B.HAMH_APPL_NUMBER WHERE HRAP_APPL_NUMBER=" + iApplNo; DataTable dt = objSQLDB.ExecuteDataSet(sAppint, CommandType.Text).Tables[0]; if (dt.Rows[0][0].ToString() == "0") { string strAppoint = CompanyCode + "," + BranchCode + "," + iApplNo + "," + EoraOCde + "," + txtApplNo.Text + "," + dtpRefDt.Value + "," + dtpEffectedDt.Value + "," + txtReportto.Text.Split('-')[0].ToString() + "," + cmbBranch.SelectedValue + "," + txtBasic_num.Text + "," + txtHRA_num.Text + "," + txtCCA_num.Text + "," + txtConv_num.Text + "," + txtSpl_num.Text + "," + txtUnif_num.Text + "," + txtChild_num.Text + "," + txtMedical_num.Text + "," + CommonData.LogUserId; sRet = objHrInfo.SaveAppointment(101, strAppoint.Split(',')); } else { string SReportto = ""; if (txtReportto.Text.Contains('-')) SReportto = txtReportto.Text.Split('-')[0].ToString(); else SReportto = txtReportto.Text; string strAppoint = CompanyCode + "," + BranchCode + "," + iApplNo + "," + EoraOCde + "," + txtApplNo.Text + "," + dtpRefDt.Value + "," + dtpEffectedDt.Value + "," + SReportto + "," + cmbBranch.SelectedValue + "," + txtBasic_num.Text + "," + txtHRA_num.Text + "," + txtCCA_num.Text + "," + txtConv_num.Text + "," + txtSpl_num.Text + "," + txtUnif_num.Text + "," + txtChild_num.Text + "," + txtMedical_num.Text + "," + CommonData.LogUserId; objHrInfo = new HRInfo(); sRet = objHrInfo.SaveAppointment(102, strAppoint.Split(',')); } if (sRet == "Saved") MessageBox.Show("This record inserted successfully.", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information); else if (sRet == "Update") MessageBox.Show("This record Updated successfully.", "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information); else { MessageBox.Show(sRet, "SSCRM Application", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DialogResult dlgResult = MessageBox.Show("Do you want print Appointment letter?", "Confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dlgResult == DialogResult.Yes) { ReportViewer childForm = new ReportViewer(iApplNo); CommonData.ViewReport = "AppointmentLetter"; childForm.Show(); } ResetFields(this); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHrInfo = null; objSQLDB = null; } }
public void FillPromotionsToGrid() { string sqlText = ""; DataTable dt = new DataTable(); //objDB = new SQLDB(); objHRInfo = new HRInfo(); gvPromotiomDetl.Rows.Clear(); string sBranch = "", sPBType = "", sDetlType = ""; if (iFormType == 1) { sDetlType = "AGENT_APPROVAL"; } else { if (cmbPBType.SelectedIndex == 0 && cmbRepToBranch.SelectedIndex == 0) { //sqlText = "SELECT HESS_TRXN_NO,HESS_LTR_REF_NO,HESS_APPL_NUMBER,HESS_EORA_CODE,MEMBER_NAME,HESS_TO_BRANCH_CODE,HESS_PROMOTION_CATEGORY_CODE" + // ",HPCM_PROMOTION_CATEGORY_NAME,HESS_BASIC,HESS_HRA,HESS_CCA,HESS_CONV_ALW,HESS_LTA_ALW,HESS_SPL_ALW,HESS_TO_COMPANY_CODE,HESS_UNF_ALW" + // ",HESS_VEH_ALW,HESS_CH_ED_ALW,HESS_BNP_ALW,HESS_MED_REIMB,HESS_PET_ALW,(HESS_BASIC+HESS_HRA+HESS_CCA+HESS_CONV_ALW+" + // "HESS_LTA_ALW+HESS_SPL_ALW+HESS_UNF_ALW+HESS_VEH_ALW+HESS_CH_ED_ALW+HESS_BNP_ALW+HESS_MED_REIMB+HESS_PET_ALW) HESS_GROSS_SAL" + // ",HESS_EFF_DATE,ISNULL(elevel_id,0) ELEVEL_ID,HESS_DESIG_ID,HESS_TO_DEPT_ID,desig_name FROM HR_EMP_SAL_STRU INNER JOIN EORA_MASTER ON ECODE = HESS_EORA_CODE INNER JOIN HR_PROMOTION_CATEGORY_MASTER " + // "ON HPCM_PROMOTION_CATEGORY_CODE = HESS_PROMOTION_CATEGORY_CODE LEFT JOIN LevelsDesig_mas ON ldm_company_code = HESS_TO_COMPANY_CODE AND LDM_DESIG_ID = HESS_DESIG_ID INNER JOIN DESIG_MAS ON desig_code = HESS_DESIG_ID " + // "WHERE HESS_APPR_STATUS='P' ORDER BY HESS_EFF_DATE ASC"; sDetlType = "ALL"; } else if (cmbPBType.SelectedIndex > 0 && cmbRepToBranch.SelectedIndex == 0) { //sqlText = "SELECT HESS_TRXN_NO,HESS_LTR_REF_NO,HESS_APPL_NUMBER,HESS_EORA_CODE,MEMBER_NAME,HESS_TO_BRANCH_CODE,HESS_PROMOTION_CATEGORY_CODE" + // ",HPCM_PROMOTION_CATEGORY_NAME,HESS_BASIC,HESS_HRA,HESS_CCA,HESS_CONV_ALW,HESS_LTA_ALW,HESS_SPL_ALW,HESS_TO_COMPANY_CODE,HESS_UNF_ALW" + // ",HESS_VEH_ALW,HESS_CH_ED_ALW,HESS_BNP_ALW,HESS_MED_REIMB,HESS_PET_ALW,(HESS_BASIC+HESS_HRA+HESS_CCA+HESS_CONV_ALW+"+ // "HESS_LTA_ALW+HESS_SPL_ALW+HESS_UNF_ALW+HESS_VEH_ALW+HESS_CH_ED_ALW+HESS_BNP_ALW+HESS_MED_REIMB+HESS_PET_ALW) HESS_GROSS_SAL"+ // ",HESS_EFF_DATE,ISNULL(elevel_id,0) ELEVEL_ID,HESS_DESIG_ID,HESS_TO_DEPT_ID,desig_name FROM HR_EMP_SAL_STRU INNER JOIN EORA_MASTER ON ECODE = HESS_EORA_CODE INNER JOIN HR_PROMOTION_CATEGORY_MASTER " + // "ON HPCM_PROMOTION_CATEGORY_CODE = HESS_PROMOTION_CATEGORY_CODE LEFT JOIN LevelsDesig_mas ON ldm_company_code = HESS_TO_COMPANY_CODE AND LDM_DESIG_ID = HESS_DESIG_ID INNER JOIN DESIG_MAS ON desig_code = HESS_DESIG_ID WHERE HESS_APPR_STATUS='P' " + // "AND HESS_PROMOTION_CATEGORY_CODE='" + cmbPBType.SelectedValue + "' ORDER BY HESS_EFF_DATE ASC"; sPBType = cmbPBType.SelectedValue.ToString(); sDetlType = "BYCAT"; } else if (cmbPBType.SelectedIndex > 0 && cmbRepToBranch.SelectedIndex > 0) { //sqlText = "SELECT HESS_TRXN_NO,HESS_LTR_REF_NO,HESS_APPL_NUMBER,HESS_EORA_CODE,MEMBER_NAME,HESS_TO_BRANCH_CODE,HESS_PROMOTION_CATEGORY_CODE" + // ",HPCM_PROMOTION_CATEGORY_NAME,HESS_BASIC,HESS_HRA,HESS_CCA,HESS_CONV_ALW,HESS_LTA_ALW,HESS_SPL_ALW,HESS_TO_COMPANY_CODE,HESS_UNF_ALW" + // ",HESS_VEH_ALW,HESS_CH_ED_ALW,HESS_BNP_ALW,HESS_MED_REIMB,HESS_PET_ALW,(HESS_BASIC+HESS_HRA+HESS_CCA+HESS_CONV_ALW+" + // "HESS_LTA_ALW+HESS_SPL_ALW+HESS_UNF_ALW+HESS_VEH_ALW+HESS_CH_ED_ALW+HESS_BNP_ALW+HESS_MED_REIMB+HESS_PET_ALW) HESS_GROSS_SAL" + // ",HESS_EFF_DATE,ISNULL(elevel_id,0) ELEVEL_ID,HESS_DESIG_ID,HESS_TO_DEPT_ID,desig_name FROM HR_EMP_SAL_STRU INNER JOIN EORA_MASTER ON ECODE = HESS_EORA_CODE INNER JOIN HR_PROMOTION_CATEGORY_MASTER " + // "ON HPCM_PROMOTION_CATEGORY_CODE = HESS_PROMOTION_CATEGORY_CODE LEFT JOIN LevelsDesig_mas ON ldm_company_code = HESS_TO_COMPANY_CODE AND LDM_DESIG_ID = HESS_DESIG_ID INNER JOIN DESIG_MAS ON desig_code = HESS_DESIG_ID WHERE HESS_APPR_STATUS='P' " + // "AND HESS_PROMOTION_CATEGORY_CODE='" + cmbPBType.SelectedValue + "' AND HESS_FROM_BRANCH_CODE = '" + cmbRepToBranch.SelectedValue + // "' ORDER BY HESS_EFF_DATE ASC"; sPBType = cmbPBType.SelectedValue.ToString(); sBranch = cmbRepToBranch.SelectedValue.ToString(); sDetlType = "BYCATBR"; } else if (cmbPBType.SelectedIndex == 0 && cmbRepToBranch.SelectedIndex > 0) { //sqlText = "SELECT HESS_TRXN_NO,HESS_LTR_REF_NO,HESS_APPL_NUMBER,HESS_EORA_CODE,MEMBER_NAME,HESS_TO_BRANCH_CODE,HESS_PROMOTION_CATEGORY_CODE" + // ",HPCM_PROMOTION_CATEGORY_NAME,HESS_BASIC,HESS_HRA,HESS_CCA,HESS_CONV_ALW,HESS_LTA_ALW,HESS_SPL_ALW,HESS_TO_COMPANY_CODE,HESS_UNF_ALW" + // ",HESS_VEH_ALW,HESS_CH_ED_ALW,HESS_BNP_ALW,HESS_MED_REIMB,HESS_PET_ALW,(HESS_BASIC+HESS_HRA+HESS_CCA+HESS_CONV_ALW+" + // "HESS_LTA_ALW+HESS_SPL_ALW+HESS_UNF_ALW+HESS_VEH_ALW+HESS_CH_ED_ALW+HESS_BNP_ALW+HESS_MED_REIMB+HESS_PET_ALW) HESS_GROSS_SAL" + // ",HESS_EFF_DATE,ISNULL(elevel_id,0) ELEVEL_ID,HESS_DESIG_ID,HESS_TO_DEPT_ID,desig_name FROM HR_EMP_SAL_STRU INNER JOIN EORA_MASTER ON ECODE = HESS_EORA_CODE INNER JOIN HR_PROMOTION_CATEGORY_MASTER " + // "ON HPCM_PROMOTION_CATEGORY_CODE = HESS_PROMOTION_CATEGORY_CODE LEFT JOIN LevelsDesig_mas ON ldm_company_code = HESS_TO_COMPANY_CODE AND LDM_DESIG_ID = HESS_DESIG_ID INNER JOIN DESIG_MAS ON desig_code = HESS_DESIG_ID " + // "WHERE HESS_APPR_STATUS='P' AND HESS_FROM_BRANCH_CODE = '" + cmbRepToBranch.SelectedValue + "' ORDER BY HESS_EFF_DATE ASC"; sBranch = cmbRepToBranch.SelectedValue.ToString(); sDetlType = "BYBR"; } } //if (sqlText.Length > 10) // dt = objDB.ExecuteDataSet(sqlText).Tables[0]; try { dt = objHRInfo.GetPromotionsDetlsForApproval("", sBranch, sPBType, sDetlType).Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { objHRInfo = null; } if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataGridViewRow tempRow = new DataGridViewRow(); DataGridViewCell tempSlNo = new DataGridViewTextBoxCell(); tempSlNo.Value = i + 1; tempRow.Cells.Add(tempSlNo); DataGridViewCell tempTrnNo = new DataGridViewTextBoxCell(); tempTrnNo.Value = dt.Rows[i]["HESS_TRXN_NO"].ToString(); tempRow.Cells.Add(tempTrnNo); DataGridViewCell tempRefNo = new DataGridViewTextBoxCell(); tempRefNo.Value = dt.Rows[i]["HESS_LTR_REF_NO"].ToString(); tempRow.Cells.Add(tempRefNo); DataGridViewCell tempApplNo = new DataGridViewTextBoxCell(); tempApplNo.Value = dt.Rows[i]["HESS_APPL_NUMBER"].ToString(); tempRow.Cells.Add(tempApplNo); DataGridViewCell tempEcode = new DataGridViewTextBoxCell(); tempEcode.Value = dt.Rows[i]["HESS_EORA_CODE"].ToString(); tempRow.Cells.Add(tempEcode); DataGridViewCell tempName = new DataGridViewTextBoxCell(); tempName.Value = dt.Rows[i]["MEMBER_NAME"].ToString(); tempRow.Cells.Add(tempName); DataGridViewCell tempBCode = new DataGridViewTextBoxCell(); tempBCode.Value = dt.Rows[i]["HESS_TO_BRANCH_CODE"].ToString(); tempRow.Cells.Add(tempBCode); DataGridViewCell tempCCode = new DataGridViewTextBoxCell(); tempCCode.Value = dt.Rows[i]["HESS_TO_COMPANY_CODE"].ToString(); tempRow.Cells.Add(tempCCode); DataGridViewCell tempDesig = new DataGridViewTextBoxCell(); tempDesig.Value = dt.Rows[i]["desig_name"].ToString(); tempRow.Cells.Add(tempDesig); DataGridViewCell tempDesigID = new DataGridViewTextBoxCell(); tempDesigID.Value = dt.Rows[i]["HESS_DESIG_ID"].ToString(); tempRow.Cells.Add(tempDesigID); DataGridViewCell tempDeptID = new DataGridViewTextBoxCell(); tempDeptID.Value = dt.Rows[i]["HESS_TO_DEPT_ID"].ToString(); tempRow.Cells.Add(tempDeptID); DataGridViewCell tempElevelID = new DataGridViewTextBoxCell(); tempElevelID.Value = dt.Rows[i]["ELEVEL_ID"].ToString(); tempRow.Cells.Add(tempElevelID); DataGridViewCell tempPCat = new DataGridViewTextBoxCell(); tempPCat.Value = dt.Rows[i]["HPCM_PROMOTION_CATEGORY_NAME"].ToString(); tempRow.Cells.Add(tempPCat); DataGridViewCell tempSal = new DataGridViewTextBoxCell(); tempSal.Value = dt.Rows[i]["HESS_GROSS_SAL"].ToString(); tempRow.Cells.Add(tempSal); DataGridViewCell tempEff = new DataGridViewTextBoxCell(); tempEff.Value = Convert.ToDateTime(dt.Rows[i]["HESS_EFF_DATE"].ToString()).ToString("dd/MMM/yyyy").ToUpper(); tempRow.Cells.Add(tempEff); gvPromotiomDetl.Rows.Add(tempRow); } } objDB = null; dt = null; }