/// <summary> /// On 'Print' button click to print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvSalaryPackage.RowCount > 0) { ////frmReport //frmReport = new frmReport(); DataSet ds = new DataSet(); SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); CompanySP spCompany = new CompanySP(); DataTable dtblSalaryPackage = spSalaryPackage.SalaryPackageViewAllForSalaryPackageReport(cmbPackageName.Text, cmbStatus.Text); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblSalaryPackage); ds.Tables.Add(dtblCompany); //frmReport.MdiParent = formMDI.MDIObj; // frmreport.SalaryPackageReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("SPD:9 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> public void GridFill() { try { SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); DataTable dtbl = spSalaryPackage.SalaryPackageViewAllForSalaryPackageReport(cmbPackageName.Text, cmbStatus.Text); dgvSalaryPackage.DataSource = dtbl; } catch (Exception ex) { MessageBox.Show("SPD:2 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill PackageName combobox /// </summary> public void PackageNameComboFill() { try { SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); DataTable dtbl = spSalaryPackage.SalaryPackageViewAll(); DataRow dr = dtbl.NewRow(); dr[1] = "All"; dtbl.Rows.InsertAt(dr, 0); cmbPackageName.DataSource = dtbl; cmbPackageName.ValueMember = "salaryPackageId"; cmbPackageName.DisplayMember = "salaryPackageName"; } catch (Exception ex) { MessageBox.Show("SPD:1 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> public void GridFill() { string strCmbName = string.Empty; try { SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); DataTable dtblSalaryPackage = new DataTable(); if (cmbStatus.Text == "Yes") { strCmbName = "True"; } else if (cmbStatus.Text == "No") { strCmbName = "False"; } else { strCmbName = "All"; } dtblSalaryPackage = spSalaryPackage.SalaryPackageregisterSearch(txtPackageName.Text.Trim(), strCmbName); dgvSalaryPackageRegister.DataSource = dtblSalaryPackage; int inRowCount = dgvSalaryPackageRegister.RowCount; for (int i = 0; i < inRowCount; i++) { if (dgvSalaryPackageRegister.Rows[i].Cells["dgvtxtActive"].Value.ToString() == "1") { dgvSalaryPackageRegister.Rows[i].Cells["dgvtxtActive"].Value = "Yes"; } if (dgvSalaryPackageRegister.Rows[i].Cells["dgvtxtActive"].Value.ToString() == "0") { dgvSalaryPackageRegister.Rows[i].Cells["dgvtxtActive"].Value = "No"; } } } catch (Exception ex) { MessageBox.Show("SPR1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Package combobox in Datagridview /// </summary> public void SalaryPackageComboFill() { try { DataTable dtblSalaryPackage = new DataTable(); SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); dtblSalaryPackage = spSalaryPackage.SalaryPackageViewAllForMonthlySalarySettings(); DataRow dr = dtblSalaryPackage.NewRow(); dr[0] = "0"; dr[1] = "--Select--"; dtblSalaryPackage.Rows.InsertAt(dr, 0); dgvcmbPackage.DataSource = dtblSalaryPackage; dgvcmbPackage.ValueMember = "salaryPackageId"; dgvcmbPackage.DisplayMember = "salaryPackageName"; } catch (Exception ex) { MessageBox.Show("MSS2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to get the details for salarypackage register /// </summary> /// <param name="strSalaryPackageName"></param> /// <param name="strStatus"></param> /// <returns></returns> public DataTable SalaryPackageregisterSearch(string strSalaryPackageName, string strStatus) { SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); DataTable dtblSalaryPackage = new DataTable(); try { SqlDataAdapter sqlda = new SqlDataAdapter("SalaryPackageregisterSearch", sqlcon); sqlda.SelectCommand.CommandType = CommandType.StoredProcedure; dtblSalaryPackage.Columns.Add("SLNO", typeof(decimal)); dtblSalaryPackage.Columns["SLNO"].AutoIncrement = true; dtblSalaryPackage.Columns["SLNO"].AutoIncrementSeed = 1; dtblSalaryPackage.Columns["SLNO"].AutoIncrementStep = 1; sqlda.SelectCommand.Parameters.Add("@salaryPackageName", SqlDbType.VarChar).Value = strSalaryPackageName; sqlda.SelectCommand.Parameters.Add("@isActive", SqlDbType.VarChar).Value = strStatus; sqlda.Fill(dtblSalaryPackage); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } return(dtblSalaryPackage); }