Ejemplo n.º 1
0
        private void btnReport_Click(object sender, EventArgs e)
        {
            ArrayList arQuery = new ArrayList();

            GTRLibrary.clsConnection clsCon = new clsConnection();

            string sqlQuery = "";
            Int32  NewId    = 0;

            string ReportPath = "", SQLQuery1 = "", FormCaption = "", DataSourceName = "DataSet1";

            DataSourceName = "DataSet1";

            FormCaption = "Report :: Loan Information...";

            try
            {
                sqlQuery = "Delete tblTempLoan";
                arQuery.Add(sqlQuery);

                foreach (UltraGridRow row in this.gridData.Rows)
                {
                    sqlQuery = "Insert Into tblTempLoan (ComId, EmpId, InstallmentNo,LoanAmt,instAmt,Balance,InterestAmt,FlatAmt,DeductAmt,dtFrom,dtTo,Rate)" +
                               " Values ('" + Common.Classes.clsMain.intComId + "', '" + cboEmpID.Value.ToString() + "', '" + row.Cells["InstallmentNo"].Text.ToString() +
                               "','" + row.Cells["LoanAmt"].Text.ToString() + "','" + row.Cells["instAmt"].Text.ToString() +
                               "','" + row.Cells["Balance"].Text.ToString() + "','" + row.Cells["InterestAmt"].Text.ToString() +
                               "','" + row.Cells["FlatAmt"].Text.ToString() + "','" + row.Cells["DeductAmt"].Text.ToString() +
                               "','" + row.Cells["dtFrom"].Text.ToString() + "','" + row.Cells["dtTo"].Text.ToString() + "'," + txtRate.Value.ToString() + ")";
                    arQuery.Add(sqlQuery);
                }

                //Transaction with database
                clsCon.GTRSaveDataWithSQLCommand(arQuery);


                ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptLoan.rdlc";
                SQLQuery1  = "Exec [rptLoanTemp] " + Common.Classes.clsMain.intComId + ",'" + cboEmpID.Value.ToString() + "'";



                clsReport.strReportPathMain = ReportPath;
                clsReport.strQueryMain      = SQLQuery1;
                clsReport.strDSNMain        = DataSourceName;

                FM.prcShowReport(FormCaption);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                arQuery = null;
                clsCon  = null;
            }
        }
Ejemplo n.º 2
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            try
            {
                string AppId = "";
                foreach (UltraGridRow row in gridList.Rows)
                {
                    //  if (row.Cells["empId"].Value.ToString() == "1")
                    //   {
                    AppId += row.Cells["AppId"].Value + ",";
                    //    }
                }
                AppId = AppId.Substring(0, AppId.Length - 1);

                string ReportPath = "", SQLQuery = "", DataSourceName = "DataSet1", FormCaption = "";

                DataSourceName = "DataSet1";
                FormCaption    = "Report :: Employee Information ...";

                //string SectId = "0", type = "", EmpId = "0";
                // SectId = gridArea.ActiveRow.Cells["SectId"].Value.ToString();
                // type = gridEmpStatus.ActiveRow.Cells["EmpStatus"].Value.ToString();
                // gridSection.ActiveRow.Cells["SectId"].Value.ToString();

                ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptAppointment.rdlc";
                SQLQuery   = "Exec [rptAppointment] " + Common.Classes.clsMain.intComId + ", '" + AppId + "' ";

                clsReport.strReportPathMain = ReportPath;
                clsReport.strQueryMain      = SQLQuery;
                clsReport.strDSNMain        = DataSourceName;

                FM.prcShowReport(FormCaption);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 3
0
        private void btnReport_Click(object sender, EventArgs e)
        {
            string ReportPath = "";
            string SQLQuery   = "";

            //Collecting Parameter Value


            //Report Criteria & Procedure
            ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptJobCardCasual.rdlc";
            SQLQuery   = "Exec rptJobCardDriver " + Common.Classes.clsMain.intComId + ",'" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "', '" + clsProc.GTRDate(dtInputToDate.Value.ToString()) + "',0,'" + cboEmpID.Value.ToString() + "','=ALL=' ";

            string DataSourceName = "DataSet1";
            string FormCaption    = "Report :: Job Card ...";

            GTRLibrary.clsReport.strReportPathMain = ReportPath;
            GTRLibrary.clsReport.strQueryMain      = SQLQuery;
            GTRLibrary.clsReport.strDSNMain        = DataSourceName;

            FM.prcShowReport(FormCaption);
        }
Ejemplo n.º 4
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            dsDetails = new DataSet();
            ArrayList     arQuery = new ArrayList();
            clsConnection clsCon  = new clsConnection();

            try
            {
                string ReportPath = "", SQLQuery = "", DataSourceName = "DataSet1", FormCaption = "";

                DataSourceName = "DataSet1";
                FormCaption    = "Report :: Employee Information ...";

                if (Common.Classes.clsMain.intComId == 2 || Common.Classes.clsMain.intComId == 3 || Common.Classes.clsMain.intComId == 4)
                {
                    string empId = "";
                    foreach (UltraGridRow row in gridTo.Rows)
                    {
                        //  if (row.Cells["empId"].Value.ToString() == "1")
                        //   {
                        empId += row.Cells["empId"].Value + ",";
                        //    }
                    }
                    empId = empId.Substring(0, empId.Length - 1);



                    //string SectId = "0", type = "", EmpId = "0";
                    // SectId = gridArea.ActiveRow.Cells["SectId"].Value.ToString();
                    // type = gridEmpStatus.ActiveRow.Cells["EmpStatus"].Value.ToString();
                    // gridSection.ActiveRow.Cells["SectId"].Value.ToString();

                    ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptIDCardPrint.rdlc";
                    SQLQuery   = "Exec [rptIdCardPrint] " + Common.Classes.clsMain.intComId + ", '" + empId + "' ";
                }

                else
                {
                    string empId = "";
                    foreach (UltraGridRow row in gridTo.Rows)
                    {
                        //  if (row.Cells["empId"].Value.ToString() == "1")
                        //   {
                        empId += row.Cells["empId"].Value + ",";
                        //    }
                    }
                    empId = empId.Substring(0, empId.Length - 1);

                    //string ReportPath = "", SQLQuery = "", DataSourceName = "DataSet1", FormCaption = "";

                    //DataSourceName = "DataSet1";
                    //FormCaption = "Report :: Employee Information ...";


                    ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptIDCardPrint.rdlc";
                    SQLQuery   = "Exec [rptIdCardPrint] " + Common.Classes.clsMain.intComId + ", '" + empId + "' ";
                }

                clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, SQLQuery);
                if (dsDetails.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Data Not Found");
                    return;
                }


                clsReport.strReportPathMain         = ReportPath;
                clsReport.dsReport                  = dsDetails;
                clsReport.strDSNMain                = DataSourceName;
                Common.Classes.clsMain.strExtension = optFormat.Value.ToString();
                Common.Classes.clsMain.strFormat    = optFormat.Text.ToString();
                FM.prcShowReport(FormCaption);
                //clsReport.strReportPathMain = ReportPath;
                //clsReport.strQueryMain = SQLQuery;
                //clsReport.strDSNMain = DataSourceName;

                //FM.prcShowReport(FormCaption);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                clsCon = null;
            }
        }