예제 #1
0
 /// <summary>
 /// ON 'Print' button click to take print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvMonthlyAttendance.Rows.Count > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List <DataTable>   dlistObjCompany    = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(dlistObjCompany[0]);
             DataTable dtblMonthlyAttendance = new DataTable();
             dtblMonthlyAttendance.Columns.Add("SlNo", typeof(Int32));
             dtblMonthlyAttendance.Columns.Add("employeeCode", typeof(string));
             dtblMonthlyAttendance.Columns.Add("employeeName", typeof(string));
             dtblMonthlyAttendance.Columns.Add("Present", typeof(string));
             dtblMonthlyAttendance.Columns.Add("Absent", typeof(string));
             foreach (DataGridViewRow dgvrow in dgvMonthlyAttendance.Rows)
             {
                 dtblMonthlyAttendance.Rows.Add();
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["SlNo"]         = dgvrow.Cells["SlNo"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeCode"] = dgvrow.Cells["employeeCode"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeName"] = dgvrow.Cells["employeeName"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["Present"]      = dgvrow.Cells["Present"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["Absent"]       = dgvrow.Cells["Absent"].Value;
             }
             ds.Tables.Add(dtblMonthlyAttendance);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.MonthlyAttendancePrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MAR15 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #2
0
 /// <summary>
 /// ON 'Print' button click to take print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvMonthlyAttendance.Rows.Count > 0)
         {
             DataSet   ds          = new DataSet();
             CompanySP spCompany   = new CompanySP();
             DataTable dtblCompany = spCompany.CompanyViewDataTable(1);
             ds.Tables.Add(dtblCompany);
             DataTable dtblMonthlyAttendance = new DataTable();
             dtblMonthlyAttendance.Columns.Add("SlNo", typeof(Int32));
             dtblMonthlyAttendance.Columns.Add("employeeCode", typeof(string));
             dtblMonthlyAttendance.Columns.Add("employeeName", typeof(string));
             dtblMonthlyAttendance.Columns.Add("Present", typeof(string));
             dtblMonthlyAttendance.Columns.Add("Absent", typeof(string));
             foreach (DataGridViewRow dgvrow in dgvMonthlyAttendance.Rows)
             {
                 dtblMonthlyAttendance.Rows.Add();
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["SlNo"]         = dgvrow.Cells["SlNo"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeCode"] = dgvrow.Cells["employeeCode"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeName"] = dgvrow.Cells["employeeName"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["Present"]      = dgvrow.Cells["Present"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["Absent"]       = dgvrow.Cells["Absent"].Value;
             }
             ds.Tables.Add(dtblMonthlyAttendance);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.MonthlyAttendancePrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "MAR15 " + ex.Message;
     }
 }
 /// <summary>
 /// ON 'Print' button click to take print
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvMonthlyAttendance.Rows.Count > 0)
         {
             DataSet ds = new DataSet();
             //CompanySP spCompany = new CompanySP();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             List<DataTable> dlistObjCompany = bllCompanyCreation.CompanyViewDataTable(1);
             ds.Tables.Add(dlistObjCompany[0]);
             DataTable dtblMonthlyAttendance = new DataTable();
             dtblMonthlyAttendance.Columns.Add("SlNo", typeof(Int32));
             dtblMonthlyAttendance.Columns.Add("employeeCode", typeof(string));
             dtblMonthlyAttendance.Columns.Add("employeeName", typeof(string));
             dtblMonthlyAttendance.Columns.Add("Present", typeof(string));
             dtblMonthlyAttendance.Columns.Add("Absent", typeof(string));
             foreach (DataGridViewRow dgvrow in dgvMonthlyAttendance.Rows)
             {
                 dtblMonthlyAttendance.Rows.Add();
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["SlNo"] = dgvrow.Cells["SlNo"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeCode"] = dgvrow.Cells["employeeCode"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeName"] = dgvrow.Cells["employeeName"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["Present"] = dgvrow.Cells["Present"].Value;
                 dtblMonthlyAttendance.Rows[dgvrow.Index]["Absent"] = dgvrow.Cells["Absent"].Value;
             }
             ds.Tables.Add(dtblMonthlyAttendance);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.MonthlyAttendancePrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MAR15 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }