示例#1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            //1=Group,3=gropParent,2=primary
            string strBranchId = "";

            if (uctxtBranch.Text == "")
            {
                MessageBox.Show("Please Select Branch Name.");
                return;
            }
            else
            {
                strBranchId = Utility.gstrGetBranchID(strComID, uctxtBranch.Text);
            }
            if (radIndividual.Checked == true)
            {
                if (uctxtLedgerConfig.Text == "")
                {
                    MessageBox.Show("Please Select Leger Group.");
                    return;
                }
            }

            if (rbtsaleschalan.Checked == true)
            {
                if (radAll.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector         = ViewerSelector.SalesChalan;
                    frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strBranchId      = strBranchId;
                    frmviewer.strString        = uctxtLedgerConfig.Text;
                    frmviewer.secondParameter1 = "Branch :" + uctxtBranch.Text;
                    frmviewer.intMode          = 1;
                    frmviewer.reportTitle2     = "A";
                    frmviewer.Show();
                }
                if (radIndividual.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector         = ViewerSelector.SalesChalan;
                    frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strBranchId      = strBranchId;
                    frmviewer.strString        = uctxtLedgerConfig.Text;
                    frmviewer.secondParameter1 = "Branch :" + uctxtBranch.Text;
                    frmviewer.intMode          = 3;
                    frmviewer.reportTitle2     = "A";
                    frmviewer.Show();
                }
            }
            else
            {
                if (radAll.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector         = ViewerSelector.SalesChalan;
                    frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strBranchId      = strBranchId;
                    frmviewer.strString        = uctxtLedgerConfig.Text;
                    frmviewer.secondParameter1 = "Branch :" + uctxtBranch.Text;
                    frmviewer.intMode          = 0;
                    frmviewer.reportTitle2     = "A";
                    frmviewer.Show();
                }
                if (radIndividual.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector         = ViewerSelector.SalesChalan;
                    frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strBranchId      = strBranchId;
                    frmviewer.strString        = uctxtLedgerConfig.Text;
                    frmviewer.secondParameter1 = "Branch :" + uctxtBranch.Text;
                    frmviewer.intMode          = 0;
                    frmviewer.reportTitle2     = "A";
                    frmviewer.Show();
                }
            }
        }
示例#2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int intSelection = 0, intGroupSelection = 0, intmonthNo, intActive = 0, intSuppress;
            //1=Group,3=gropParent,2=primary
            string strBranchId = "", strMonthID = "", strName = "";
            long   lngcount = 0;

            if (radLedgerW.Checked == true)
            {
                intSuppress = 1;
            }
            else
            {
                intSuppress = 0;
            }

            if (uctxtBranch.Text == "")
            {
                MessageBox.Show("Please Select Branch Name.");
                return;
            }
            else
            {
                strBranchId = Utility.gstrGetBranchID(strComID, uctxtBranch.Text);
            }
            if (radIndividual.Checked == true)
            {
                if (uctxtLedgerConfig.Text == "")
                {
                    MessageBox.Show("Please Select Leger Group.");
                    return;
                }
            }
            intSelection = 1;
            if (radIndividual.Checked == true)
            {
                if (radGroupwise.Checked == true)
                {
                    intSelection = 1;
                }
                else
                {
                    intSelection = 2;
                }

                strName = uctxtLedgerConfig.Text;
            }
            if (chkStatus.Checked == true)
            {
                intActive = 0;
            }
            else
            {
                intActive = 1;
            }

            if (cbxSelection.Text != "")
            {
                intSelection = 0;
                if (cbxSelection.Text == "MPO")
                {
                    intGroupSelection = 1;
                    intSuppress       = 1;
                    intSelection      = 1;
                }
                if (cbxSelection.Text == "ZONE")
                {
                    intGroupSelection = 2;
                }
                if (cbxSelection.Text == "DIVISION")
                {
                    intGroupSelection = 3;
                }
                if (cbxSelection.Text == "AREA")
                {
                    intGroupSelection = 4;
                }
            }

            intmonthNo = dteFromDate.Value.Month;
            lngcount   = Utility.DateDiff(Utility.DateInterval.Month, dteFromDate.Value, dteToDate.Value);
            DateTime dteFdate = dteFromDate.Value;

            for (int i = intmonthNo; i <= lngcount; i++)
            {
                strMonthID = strMonthID + "'" + dteFdate.ToString("MMMyy").ToUpper() + "',";
                dteFdate   = dteFdate.AddMonths(1);
            }

            if (strMonthID != "")
            {
                strMonthID = Utility.Mid(strMonthID, 0, strMonthID.Length - 1);
            }

            frmReportViewer frmviewer = new frmReportViewer();

            frmviewer.selector       = ViewerSelector.TargetAchievement;
            frmviewer.strFdate       = dteFromDate.Value.ToString("dd-MM-yyyy");
            frmviewer.strTdate       = dteToDate.Value.ToString("dd-MM-yyyy");
            frmviewer.strBranchID    = strBranchId;
            frmviewer.strString      = strName;
            frmviewer.strSelction    = strMonthID;
            frmviewer.intSummDetails = intSelection;
            frmviewer.intNarration   = intActive;
            frmviewer.intSuppress    = intSuppress;
            frmviewer.intSP          = intGroupSelection;
            frmviewer.Show();
        }
示例#3
0
        private void commandButton1_Click(object sender, EventArgs e)
        {
            bool    import = true;
            DataSet ds     = new DataSet();

            if (cbIMLOK.Text == "IMPORT")
            {
                import = true;
            }
            else if (cbIMLOK.Text == "LOKAL")
            {
                import = false;
            }

            try
            {
                this.Cursor = Cursors.WaitCursor;
                List <ReportParameter> rptParams = new List <ReportParameter>();

                string titleReport = cbIMLOK.Text;
                rptParams.Add(new ReportParameter("titleReport", titleReport));

                string periodReport = monthYearBox1.LastDateOfMonth.Day + " " + monthYearBox1.MonthName + " " + monthYearBox1.Year.ToString();
                rptParams.Add(new ReportParameter("periodeReport", periodReport));

                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("rsp_rincian_hutang_lokal"));
                    db.Commands[0].Parameters.Add(new Parameter("@StartDate", SqlDbType.DateTime, monthYearBox1.FirstDateOfMonth.ToString()));
                    db.Commands[0].Parameters.Add(new Parameter("@import", SqlDbType.Bit, import));
                    if (cboPerusahaan.Text != "")
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@RowIDPerusahaan", SqlDbType.UniqueIdentifier, _RowIDPerusahaan));
                    }

                    ds = db.Commands[0].ExecuteDataSet();
                }

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (cbIMLOK.Text == "LOKAL")
                    {
                        ifrmReport = new frmReportViewer("Hutang.Report.laporanRincianHutangLokal.rdlc", rptParams, ds.Tables[0], "dsRincianHutangLokal_rincianHutangLokal");
                    }
                    //if (cbIMLOK.Text == "IMPORT")
                    //{
                    //    ifrmReport = new frmReportViewer("Keuangan.Hutang.Report.laporanRekapHutang.rdlc", rptParams, ds.Tables[0], "dsRincianHutangLokal_rincianHutangLokal");
                    //}
                    ifrmReport.Text = "Rekap Hutang " + periodReport;
                    ifrmReport.Show();
                }
                else
                {
                    MessageBox.Show("Data tidak Ada");
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
示例#4
0
        private void DisplayReport(DataSet ds)
        {
            try
            {
                DateTime da  = new DateTime(dateTextBox1.DateValue.Value.Year, dateTextBox1.DateValue.Value.Month, 1);
                DateTime da2 = dateTextBox1.DateValue.Value;

                string periode = string.Empty;
                periode = String.Format("{0} s/d {1}", da.ToString("dd/MM/yyyy"), da2.ToString("dd/MM/yyyy"));
                DateTime d1 = (DateTime)dateTextBox1.DateValue;

                this.Cursor = Cursors.WaitCursor;
                List <ReportParameter> rptParams = new List <ReportParameter>();
                rptParams.Add(new ReportParameter("Periode", periode));
                rptParams.Add(new ReportParameter("Initial", GlobalVar.PerusahaanName + "-" + GlobalVar.Gudang));
                rptParams.Add(new ReportParameter("User", SecurityManager.UserInitial + " " + DateTime.Now.ToString("dd/MM/yyyy")));
                if (checkBox1.Checked)
                {
                    rptParams.Add(new ReportParameter("Title", " LAPORAN AGING SCHEDULE PIUTANG NOTA (RAGU RAGU)"));
                }
                else
                {
                    rptParams.Add(new ReportParameter("Title", " LAPORAN AGING SCHEDULE PIUTANG NOTA"));
                }
                //call report viewer
                frmReportViewer ifrmReport = new frmReportViewer("Piutang.Report.rpt23AgingScheduleNotaGiro2A.rdlc", rptParams, ds.Tables[0], "dsKpiutang_Data");
                ifrmReport.Text = "LAPORAN AGING SCHEDULE PIUTANG NOTA (A)";


                rptParams.RemoveAt(3);
                rptParams.Add(new ReportParameter("Title", " LAPORAN AGING SCHEDULE PIUTANG GIRO"));

                //call report viewer
                frmReportViewer ifrmReport1 = new frmReportViewer("Piutang.Report.rpt23AgingScheduleNotaGiro2B.rdlc", rptParams, ds.Tables[1], "dsKpiutang_Data1");
                ifrmReport1.Text = "LAPORAN AGING SCHEDULE PIUTANG GIRO (B)";



                rptParams.RemoveAt(3);
                rptParams.Add(new ReportParameter("Title", " LAPORAN REKAP AGING SCHEDULE PIUTANG"));

                //call report viewer
                frmReportViewer ifrmReport2 = new frmReportViewer("Piutang.Report.rpt23AgingScheduleNotaGiro2C.rdlc", rptParams, ds.Tables[2], "dsKpiutang_Data2");
                ifrmReport2.Text = "LAPORAN REKAP AGING SCHEDULE PIUTANG (C)";


                rptParams.RemoveAt(3);
                rptParams.Add(new ReportParameter("Title", " LAPORAN REKAP AGING SCHEDULE PIUTANG"));

                //call report viewer
                frmReportViewer ifrmReport3 = new frmReportViewer("Piutang.Report.rpt23AgingScheduleNotaGiro2D.rdlc", rptParams, ds.Tables[3], "dsKpiutang_Data3");
                ifrmReport3.Text = "LAPORAN REKAP AGING SCHEDULE PIUTANG (D)";


                //call report viewer
                frmReportViewer ifrmReport4 = new frmReportViewer("Piutang.Report.rpt23AgingScheduleNotaGiro2E.rdlc", rptParams, ds.Tables[4], "dsKpiutang_Data3");
                ifrmReport4.Text = "LAPORAN REKAP AGING SCHEDULE PIUTANG (E)";

                //call report viewer
                frmReportViewer ifrmReport5 = new frmReportViewer("Piutang.Report.rpt23AgingScheduleNotaGiro2F_V2.rdlc", rptParams, ds.Tables[5], "dsKpiutang_Data1");
                ifrmReport5.Text = "LAPORAN REKAP AGING SCHEDULE PIUTANG (F)";

                ifrmReport.Show();
                ifrmReport1.Show();
                ifrmReport2.Show();
                ifrmReport3.Show();
                ifrmReport4.Show();
                ifrmReport5.Show();
            }
            catch (System.Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (strSelection == "A")
            {
                if (radAll.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector = ViewerSelector.ProductShortDetails;
                    frmviewer.strFdate = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.intMode  = 1;
                    frmviewer.Show();
                    return;
                }

                if (radIndividual.Checked == true)
                {
                    if (uctxtGroupConfig.Text == "")
                    {
                        MessageBox.Show("Please Select Group Name.");
                        return;
                    }
                }

                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector  = ViewerSelector.ProductShortDetails;
                    frmviewer.strFdate  = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate  = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strString = uctxtGroupConfig.Text;
                    frmviewer.intMode   = 1;
                    frmviewer.Show();
                    return;
                }
            }
            else
            {
                if (radAll.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector = ViewerSelector.ProductShortDetails;
                    frmviewer.strFdate = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.intMode  = 2;
                    frmviewer.Show();
                    return;
                }

                if (radIndividual.Checked == true)
                {
                    if (uctxtLedgerConfig.Text == "")
                    {
                        MessageBox.Show("Please Select MPO Name.");
                        return;
                    }
                }

                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector  = ViewerSelector.ProductShortDetails;
                    frmviewer.strFdate  = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate  = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strString = uctxtLedgerConfig.Text;
                    frmviewer.intMode   = 2;
                    frmviewer.Show();
                    return;
                }
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strBranchId     = "";
            string strReportOption = "";
            string strValOption    = "";
            double dblAmount       = 0;

            if (uctxtBranch.Text == "")
            {
                MessageBox.Show("Please Select Branch Name.");
                return;
            }
            if (dteFromDate.Value > dteToDate.Value)
            {
                MessageBox.Show("Please Check Date.");
                return;
            }

            else
            {
                strBranchId = Utility.gstrGetBranchID(strComID, uctxtBranch.Text);
            }
            if (txtLess.Text != "")
            {
                dblAmount    = Convert.ToDouble((txtLess.Text).ToString());
                strValOption = "<";
            }
            if (TxtGreater.Text != "")
            {
                dblAmount    = Convert.ToDouble((TxtGreater.Text).ToString());
                strValOption = ">";
            }


            if (cheMPO.Checked == true)
            {
                strReportOption = "MPO";
            }
            if (cheFMAM.Checked == true)
            {
                strReportOption = "AM";
            }
            if (cheRSMDSM.Checked == true)
            {
                strReportOption = "DSM";
            }
            if (cheZone.Checked == true)
            {
                strReportOption = "ZONE";
            }

            if ((radAll.Checked == true) && (cheZone.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.CollectionStatementZone;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.dblAmount        = dblAmount;
                frmviewer.strString2       = strValOption;
                frmviewer.strString3       = strReportOption;
                frmviewer.secondParameter1 = "Branch : " + uctxtBranch.Text;
                frmviewer.strString        = "";
                frmviewer.reportTitle2     = "A";
                frmviewer.Show();
                return;
            }
            if ((radAll.Checked == true) && (cheRSMDSM.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.CollectionStatementRSM;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.dblAmount        = dblAmount;
                frmviewer.strString2       = strValOption;
                frmviewer.strString3       = strReportOption;
                frmviewer.secondParameter1 = "Branch : " + uctxtBranch.Text;
                frmviewer.strString        = "";
                frmviewer.reportTitle2     = "A";
                frmviewer.intMode          = 0;
                frmviewer.Show();
                return;
            }
            if ((radAll.Checked == true) && (cheMPO.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.CollectionStatementMPO;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.dblAmount        = dblAmount;
                frmviewer.strString2       = strValOption;
                frmviewer.strString3       = strReportOption;
                frmviewer.strString        = uctxtMrName.Text;
                frmviewer.secondParameter1 = "Branch : " + uctxtBranch.Text;
                frmviewer.reportTitle2     = "A";
                frmviewer.intMode          = 0;
                frmviewer.Show();
                return;
            }
            if ((radAll.Checked == true) && (cheFMAM.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.CollectionStatementFM;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.dblAmount        = dblAmount;
                frmviewer.strString2       = strValOption;
                frmviewer.strString3       = strReportOption;
                frmviewer.secondParameter1 = "Branch : " + uctxtBranch.Text;
                frmviewer.strString        = "";
                frmviewer.reportTitle2     = "A";
                frmviewer.Show();
                return;
            }
            if (radAll.Checked == true)
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.allMpoCollectionStatement;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.dblAmount        = dblAmount;
                frmviewer.strString2       = strValOption;
                frmviewer.strString3       = strReportOption;
                frmviewer.secondParameter1 = "Branch : " + uctxtBranch.Text;
                frmviewer.strString        = "";
                frmviewer.reportTitle2     = "A";
                frmviewer.strString        = "";
                frmviewer.Show();
            }
            if (radIndividual.Checked == true)
            {
                if (uctxtMrName.Text == "")
                {
                    MessageBox.Show("Please Select MPO Name.");
                    return;
                }
                if (radIndividual.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector         = ViewerSelector.CollectionStatementIndividualF;
                    frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strBranchId      = strBranchId;
                    frmviewer.strString        = uctxtMrName.Text;
                    frmviewer.secondParameter1 = "Branch : " + uctxtBranch.Text;
                    frmviewer.strSelction      = uctxtMrName.Text;
                    frmviewer.reportTitle2     = "A";
                    frmviewer.intMode          = 5;
                    frmviewer.Show();
                    return;
                }
            }
        }
示例#7
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if ((rbtnAll.Checked == true) && (chkboxSummary.Checked == true))
            {
                string          strBrachID = "";
                frmReportViewer frmviewer  = new frmReportViewer();
                frmviewer.selector      = ViewerSelector.rptPurchesSumm;
                frmviewer.strFdate      = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate      = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.intSuppress   = 1;
                frmviewer.reportTitle2  = "A";
                frmviewer.strLedgerName = "";
                if (strSelection == "SalesReg")
                {
                    frmviewer.strString2 = "16";
                }
                if (strSelection == "PurchaseReg")
                {
                    frmviewer.strString2 = "33";
                }
                if (strSelection == "SalesReturn")
                {
                    frmviewer.strString2 = "13";
                }
                if (strSelection == "PurchaseReturn")
                {
                    frmviewer.strString2 = "32";
                }
                frmviewer.Show();
                return;
            }
            if ((rbtnIndividualParty.Checked == true) && (chkboxSummary.Checked == true))
            {
                string          strBrachID = "";
                frmReportViewer frmviewer  = new frmReportViewer();
                frmviewer.selector      = ViewerSelector.rptPurchesSumm;
                frmviewer.strFdate      = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate      = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strLedgerName = uctxtMrName.Text;
                frmviewer.reportTitle2  = "A";
                frmviewer.intSuppress   = 0;
                if (strSelection == "SalesReg")
                {
                    frmviewer.strString2 = "16";
                }
                if (strSelection == "PurchaseReg")
                {
                    frmviewer.strString2 = "33";
                }
                if (strSelection == "SalesReturn")
                {
                    frmviewer.strString2 = "13";
                }
                if (strSelection == "PurchaseReturn")
                {
                    frmviewer.strString2 = "32";
                }
                frmviewer.Show();
                return;
            }

            if (rbtnAll.Checked == true)
            {
                string          strBrachID = "";
                frmReportViewer frmviewer  = new frmReportViewer();
                frmviewer.selector      = ViewerSelector.rptPurchesAll;
                frmviewer.strFdate      = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate      = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.reportTitle2  = "A";
                frmviewer.strLedgerName = "";
                if (strSelection == "SalesReg")
                {
                    frmviewer.strString2 = "16";
                }
                if (strSelection == "PurchaseReg")
                {
                    frmviewer.strString2 = "33";
                }
                if (strSelection == "SalesReturn")
                {
                    frmviewer.strString2 = "13";
                }
                if (strSelection == "PurchaseReturn")
                {
                    frmviewer.strString2 = "32";
                }
                frmviewer.Show();
                return;
            }

            if (rbtnIndividualParty.Checked == true)
            {
                string          strBrachID = "";
                frmReportViewer frmviewer  = new frmReportViewer();
                frmviewer.selector      = ViewerSelector.rptPurchesAll;
                frmviewer.strFdate      = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate      = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strLedgerName = uctxtMrName.Text;
                frmviewer.reportTitle2  = "A";
                if (strSelection == "SalesReg")
                {
                    frmviewer.strString2 = "16";
                }
                if (strSelection == "PurchaseReg")
                {
                    frmviewer.strString2 = "33";
                }
                if (strSelection == "SalesReturn")
                {
                    frmviewer.strString2 = "13";
                }
                if (strSelection == "PurchaseReturn")
                {
                    frmviewer.strString2 = "32";
                }
                frmviewer.Show();
                return;
            }
        }
示例#8
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strBranchId = "", strString2 = "", strString3 = "", strString4 = "";


            int intmode = 0, intSelection = 0;

            if (rbtnMPO.Checked == true)
            {
                intmode = 4;
            }
            if (rbtnAMFM.Checked == true)
            {
                intmode = 3;
            }
            if (rbtnDSMRSM.Checked == true)
            {
                intmode = 2;
            }
            if (rbtnZONE.Checked == true)
            {
                intmode = 1;
            }


            if (uctxtBranch.Text == "")
            {
                MessageBox.Show("Please Select Branch Name.");
                return;
            }
            else
            {
                strBranchId = Utility.gstrGetBranchID(strComID, uctxtBranch.Text);
            }

            if (txtMonthID.Text == "")
            {
                MessageBox.Show("Please Select Month.");
                txtMonthID.Focus();
                return;
            }

            if (lstRightP.Items.Count <= 0)
            {
                MessageBox.Show("Data Not Found.");
                return;
            }
            {
                for (int i = 0; i < lstRightP.Items.Count; i++)
                {
                    strString3 = strString3 + "'" + lstRightP.Items[i].ToString().Replace("'", "''") + "',";
                    strString4 = strString4 + "" + lstRightP.Items[i].ToString().Replace("'", "''") + ",";
                }
                if (strString3 != "")
                {
                    strString3 = Utility.Mid(strString3, 0, strString3.Length - 1);
                    strString4 = Utility.Mid(strString4, 0, strString4.Length - 1);
                }
            }

            if (lstRight.Items.Count <= 0)
            {
                MessageBox.Show("Data Not Found.");
                return;
            }
            {
                for (int i = 0; i < lstRight.Items.Count; i++)
                {
                    strString2 = strString2 + "'" + lstRight.Items[i].ToString().Replace("'", "''") + "',";
                }
                if (strString2 != "")
                {
                    strString2 = Utility.Mid(strString2, 0, strString2.Length - 1);
                }
            }

            progressBar1.Value = 0;

            string[] words = strString4.Split(',');
            progressBar1.Maximum = words.Count();
            foreach (string ooObj in words)
            {
                if (ooObj != "")
                {
                    string strProjectionName = ooObj.ToString();

                    List <PCollectionCopmarison> oLedger = objExtra.mGetMontlyLadgerProjection(strComID, txtMonthID.Text, strString2).ToList();
                    if (oLedger.Count > 0)
                    {
                        foreach (PCollectionCopmarison ooL in oLedger)
                        {
                            List <PCollectionCopmarison> objPerfo = objExtra.mGetProjectionReport(strComID, strProjectionName, txtMonthID.Text, "", intSelection, ooL.strLedgerName, strString2).ToList();
                            intSelection += 1;
                        }
                    }
                }
                int percent = (int)(((double)(progressBar1.Value - progressBar1.Minimum) / (double)(progressBar1.Maximum - progressBar1.Minimum)) * 100);
                progressBar1.Refresh();
                using (Graphics gr = progressBar1.CreateGraphics())
                {
                    gr.DrawString(percent.ToString() + "%", SystemFonts.DefaultFont, Brushes.Red, new PointF(progressBar1.Width / 2 - (gr.MeasureString(percent.ToString() + "%",
                                                                                                                                                        SystemFonts.DefaultFont).Width / 2.0F), progressBar1.Height / 2 - (gr.MeasureString(percent.ToString() + "%", SystemFonts.DefaultFont).Height / 2.0F)));
                }
                progressBar1.Value += 1;
            }



            frmReportViewer frmviewer = new frmReportViewer();

            frmviewer.selector    = ViewerSelector.ProjectionR;
            frmviewer.intPosition = intmode;
            frmviewer.strString1  = txtMonthID.Text;
            frmviewer.strString2  = strString3;
            //frmviewer.strFdate = strString4;
            //frmviewer.strledgerName = strString2;
            frmviewer.Show();
        }
示例#9
0
        private void DisplayReport()
        {
            List <ReportParameter> rptParams    = new List <ReportParameter>();
            List <DataTable>       pTable       = new List <DataTable>();
            List <string>          pDatasetName = new List <string>();

            #region dtReport1

            DataTable dtReport1 = new DataTable();
            dtReport1.Columns.Add("Cabang2", typeof(string));
            dtReport1.Columns.Add("Nota", typeof(string));
            dtReport1.Columns.Add("TglNota", typeof(DateTime));
            dtReport1.Columns.Add("DO", typeof(string));
            dtReport1.Columns.Add("TglDO", typeof(DateTime));
            dtReport1.Columns.Add("Sales", typeof(string));
            dtReport1.Columns.Add("Toko", typeof(string));
            dtReport1.Columns.Add("Alamat", typeof(string));
            dtReport1.Columns.Add("Kota", typeof(string));
            dtReport1.Columns.Add("NamaStok", typeof(string));
            dtReport1.Columns.Add("Jumlah", typeof(int));
            dtReport1.Columns.Add("Harga", typeof(double));
            dtReport1.Columns.Add("Diskon", typeof(double));
            dtReport1.Columns.Add("nPot", typeof(double));

            string   cabang2 = string.Empty;
            string   noNota  = string.Empty;
            DateTime tglNota;
            string   noDO = string.Empty;
            DateTime tglDO;
            string   sales    = string.Empty;
            string   namaToko = string.Empty;
            string   alamat   = string.Empty;
            string   kota     = string.Empty;
            string   namaStok = string.Empty;
            int      jumlah   = 0;
            double   harga    = 0;
            //double nBruto = 0;
            double nDiskon = 0;
            //double nPot = 0;

            foreach (DataRow dr in dtProses.Rows)
            {
                cabang2  = Tools.isNull(dr["Cab2"], "").ToString().Trim();
                noNota   = Tools.isNull(dr["No_sj"], "").ToString().Trim();
                tglNota  = DateTime.Parse(Tools.isNull(dr["Tgl_sj"], DBNull.Value).ToString());
                noDO     = Tools.isNull(dr["No_do"], "").ToString().Trim();
                tglDO    = DateTime.Parse(Tools.isNull(dr["Tgl_do"], DBNull.Value).ToString());
                sales    = Tools.isNull(dr["kd_sales"], "").ToString().Trim();
                namaToko = Tools.isNull(dr["Nm_toko"], "").ToString().Trim();
                alamat   = Tools.isNull(dr["Al_kirim"], "").ToString().Trim();
                kota     = Tools.isNull(dr["kota"], "").ToString().Trim();

                double pot;
                double disc1;
                double disc2;
                double disc3;
                string discFormula;

                DataRow[] orderDetails = dt2.Select("idtr='" + dr["idtr"].ToString() + "'");
                foreach (DataRow drd in orderDetails)
                {
                    namaStok    = Tools.isNull(drd["Nama_stok"], "").ToString().Trim();
                    disc1       = double.Parse(Tools.isNull(drd["disc_1"], "").ToString());
                    disc2       = double.Parse(Tools.isNull(drd["disc_2"], "").ToString());
                    disc3       = double.Parse(Tools.isNull(drd["disc_3"], "").ToString());
                    discFormula = Tools.isNull(drd["Id_disc"], "").ToString().Trim();
                    jumlah      = int.Parse(Tools.isNull(drd["J_sj"], "0").ToString());
                    harga       = double.Parse(Tools.isNull(drd["H_jual"], "").ToString());
                    nDiskon     = (jumlah * harga) - GetNetDisc((jumlah * harga), disc1, disc2, disc3, discFormula);
                    pot         = double.Parse(Tools.isNull(drd["Pot_rp"], "").ToString()) * double.Parse(Tools.isNull(drd["J_sj"], "").ToString());

                    dtReport1.Rows.Add(cabang2, noNota, tglNota, noDO, tglDO, sales, namaToko, alamat, kota, namaStok, jumlah, harga, nDiskon, pot);
                }
            }
            #endregion

            rptParams.Add(new ReportParameter("Gudang", lookupGudang.GudangID));
            rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID));

            dtPJ2.Columns["Cab2"].ColumnName     = "Cabang2";
            dtPJ2.Columns["No_sj"].ColumnName    = "Nota";
            dtPJ2.Columns["Tgl_sj"].ColumnName   = "TglNota";
            dtPJ2.Columns["Kd_sales"].ColumnName = "Sales";
            dtPJ2.Columns["Nm_toko"].ColumnName  = "Toko";
            dtPJ2.Columns["Al_kirim"].ColumnName = "Alamat";
            dtPJ2.Columns["Kota"].ColumnName     = "Kota";

            dtNoDetail.Columns["Cab2"].ColumnName     = "Cabang2";
            dtNoDetail.Columns["No_sj"].ColumnName    = "Nota";
            dtNoDetail.Columns["Tgl_sj"].ColumnName   = "TglNota";
            dtNoDetail.Columns["Kd_sales"].ColumnName = "Sales";
            dtNoDetail.Columns["Nm_toko"].ColumnName  = "Toko";
            dtNoDetail.Columns["Al_kirim"].ColumnName = "Alamat";
            dtNoDetail.Columns["Kota"].ColumnName     = "Kota";

            pTable.Add(dtReport1);
            pTable.Add(dtPJ2);
            pTable.Add(dtNoDetail);

            pDatasetName.Add("dsSales_Data");
            pDatasetName.Add("dsSales_Data1");
            pDatasetName.Add("dsSales_Data2");

            frmReportViewer ifrmReport = new frmReportViewer("Communicator.rptPenjualanNotaDownloadC2.rdlc", rptParams, pTable, pDatasetName);

            ifrmReport.Show();
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strMonthID = "", strString2 = "";

            int intSelection = 0, intSumm = 0, intBaseTarget = 0, intReportOption = 0, intspreport = 1, intDetails = 0;


            if (uctxtBranch.Text == "")
            {
                MessageBox.Show("Please Select Branch Name.");
                return;
            }
            else
            {
                strBranchId = Utility.gstrGetBranchID(strComID, uctxtBranch.Text);
            }

            if (radAllStatus.Checked == true)
            {
                intSelection = 2;
            }
            else if (radActive.Checked == true)
            {
                intSelection = 0;
            }
            else if (radInactive.Checked == true)
            {
                intSelection = 1;
            }

            if (radAll.Checked == true)
            {
                intReportOption = 1;
            }
            else if (radMpo.Checked == true)
            {
                intReportOption = 2;
            }
            else if (rbtnArea.Checked == true)
            {
                intReportOption = 3;
            }
            else if (rbtnDivision.Checked == true)
            {
                intReportOption = 4;
            }
            else if (rbtnZone.Checked == true)
            {
                intReportOption = 5;
            }
            else
            {
                intReportOption = 0;
            }

            if (chkBaseTarget.Checked == true)
            {
                intBaseTarget = 1;
            }
            else
            {
                intBaseTarget = 0;
            }


            if (chkboxSpecial.Checked != true)
            {
                intspreport      = 0;
                dteFromDate.Text = Utility.FirstDayOfMonth(dteFromDate.Value).ToString();
                //dteToDate.Text = Utility.LastDayOfMonth(dteToDate.Value).ToString();
                dteToDate.Text = dteToDate.Text;
            }


            if (radAll.Checked == true)
            {
                intSumm = 1;
            }
            if (chkboxDetails.Checked == true)
            {
                intDetails = 1;
            }
            DateTime dateTimePicker1 = dteFromDate.Value;

            int intTotalMonth = Utility.GetMonthDifference(dteToDate.Value, dteFromDate.Value);

            for (int introw = 1; introw <= intTotalMonth; introw++)
            {
                strMonthID      = strMonthID + "'" + dateTimePicker1.ToString("MMMyy").ToUpper() + "',";
                dateTimePicker1 = dateTimePicker1.AddMonths(1);
            }
            if (strMonthID != "")
            {
                strMonthID = Utility.Mid(strMonthID, 0, strMonthID.Length - 1);
            }


            if (radAll.Checked != true)
            {
                if (lstRight.Items.Count <= 0)
                {
                    MessageBox.Show("Data Not Found.");
                    return;
                }
            }

            for (int i = 0; i < lstRight.Items.Count; i++)
            {
                strString2 = strString2 + "'" + lstRight.Items[i].ToString().Replace("'", "''") + "',";
            }
            if (strString2 != "")
            {
                strString2 = Utility.Mid(strString2, 0, strString2.Length - 1);
            }
            frmReportViewer frmviewer = new frmReportViewer();

            frmviewer.selector         = ViewerSelector.MarketMonitoring;
            frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
            frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
            frmviewer.strBranchID      = strBranchId;
            frmviewer.intNarration     = intSelection;
            frmviewer.intVtype         = intReportOption;
            frmviewer.intSummDetails   = intSumm;
            frmviewer.strString        = strMonthID;
            frmviewer.intTarget        = intBaseTarget;
            frmviewer.intSP            = intspreport;
            frmviewer.intValueSuppress = intDetails;
            frmviewer.strString2       = strString2;
            frmviewer.Show();
        }
示例#11
0
        private void print()
        {
            DateTime _fromdate      = (DateTime)rangeDateBoxLapRekonBank.FromDate;
            DateTime _todate        = (DateTime)rangeDateBoxLapRekonBank.ToDate;
            DateTime _TglDari       = (DateTime)rangeDateBoxLapRekonBank.FromDate;
            DateTime _TglSampai     = (DateTime)rangeDateBoxLapRekonBank.ToDate;
            DateTime _TglSampaiAwal = _TglDari.AddDays(-1);
            DateTime _TglDariAwal   = _TglSampaiAwal.AddDays(_TglSampaiAwal.Day * -1 + 1);
            Guid     RekeningRowID  = (Guid)lookUpBankRekening1.RowID;
            string   _TahunBulan    = _TglDari.Year.ToString() + _TglDari.Month.ToString().PadLeft(2, '0');

            if (tabControl1.SelectedIndex.Equals(0))
            {
                if (dateTextBoxLaprekonBank.Text.Equals(string.Empty))
                {
                    return;
                }
                DateTime _tgl = (DateTime)dateTextBoxLaprekonBank.DateValue;

                if (dateTextBoxLaprekonBank.Text.Equals(string.Empty))
                {
                    MessageBox.Show("Tanggal Belum diisi."); return;
                }


                DataTable dt          = new DataTable();
                DataTable dtSaldoAwal = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_RekonBank_REPORT"));
                    db.Commands[0].Parameters.Add(new Parameter("@Tanggal", SqlDbType.Date, dateTextBoxLaprekonBank.DateValue));
                    dt = db.Commands[0].ExecuteDataTable();

                    db.Commands.Clear();

                    db.Commands.Add(db.CreateCommand("usp_GetSaldoBukuBank_BY_TahunBulan"));
                    //db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, RekeningRowID));
                    db.Commands[0].Parameters.Add(new Parameter("@TahunBulan", SqlDbType.Char, _TahunBulan));

                    if (_TglDari != _TglDari.AddDays(_TglDari.Day * -1 + 1))
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@FromDate", SqlDbType.Date, _TglDariAwal));
                        db.Commands[0].Parameters.Add(new Parameter("@ToDate", SqlDbType.Date, _TglSampaiAwal));
                    }


                    dtSaldoAwal = db.Commands[0].ExecuteDataTable();
                    double _SaldoAwal    = Convert.ToDouble(Tools.isNull(dtSaldoAwal.Rows[0]["Saldo"], 0));
                    double _SaldoAwalORI = Convert.ToDouble(Tools.isNull(dtSaldoAwal.Rows[0]["SaldoORI"], 0));


                    List <ReportParameter> rptParams = new List <ReportParameter>();
                    rptParams.Add(new ReportParameter("Tanggal", _tgl.ToString()));
                    rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID));
                    rptParams.Add(new ReportParameter("SaldoAwal", _SaldoAwal.ToString()));
                    rptParams.Add(new ReportParameter("SaldoAwalORI", _SaldoAwalORI.ToString()));



                    frmReportViewer ifrmReport = new frmReportViewer("Laporan.Finance.rptRekonbank.rdlc", rptParams, dt, "dsRekonBank_usp_RekonBank_REPORT");
                    ifrmReport.Show();
                }
            }
            if (tabControl1.SelectedIndex.Equals(1))
            {
                string _NamaBank = lookUpBankRekening1.lblLookupNamaBank.Text;
                string _Rekening = lookUpBankRekening1.lblNoRekening.Text;
                string _AtasNama = lookUpBankRekening1.lblNamaRekening.Text;

                DataTable dt          = new DataTable();
                DataTable dtSaldoAwal = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_RekonBank_REPORT"));
                    db.Commands[0].Parameters.Add(new Parameter("@Fromdate", SqlDbType.Date, rangeDateBoxLapRekonBank.FromDate));
                    db.Commands[0].Parameters.Add(new Parameter("@Todate", SqlDbType.Date, rangeDateBoxLapRekonBank.ToDate));
                    db.Commands[0].Parameters.Add(new Parameter("@RekeningRowID", SqlDbType.UniqueIdentifier, RekeningRowID));
                    dt = db.Commands[0].ExecuteDataTable();

                    db.Commands.Clear();

                    db.Commands.Add(db.CreateCommand("usp_GetSaldoBukuBank_BY_TahunBulan"));
                    db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, RekeningRowID));
                    db.Commands[0].Parameters.Add(new Parameter("@TahunBulan", SqlDbType.Char, _TahunBulan));

                    if (_TglDari != _TglDari.AddDays(_TglDari.Day * -1 + 1))
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@FromDate", SqlDbType.Date, _TglDariAwal));
                        db.Commands[0].Parameters.Add(new Parameter("@ToDate", SqlDbType.Date, _TglSampaiAwal));
                    }



                    dtSaldoAwal = db.Commands[0].ExecuteDataTable();
                    double _SaldoAwal    = Convert.ToDouble(Tools.isNull(dtSaldoAwal.Rows[0]["Saldo"], 0));
                    double _SaldoAwalORI = Convert.ToDouble(Tools.isNull(dtSaldoAwal.Rows[0]["SaldoORI"], 0));


                    List <ReportParameter> rptParams = new List <ReportParameter>();
                    rptParams.Add(new ReportParameter("NamaBank", _NamaBank.ToString()));
                    rptParams.Add(new ReportParameter("FromDate", _TglDari.ToString()));
                    rptParams.Add(new ReportParameter("ToDate", _TglSampai.ToString()));
                    rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID));
                    rptParams.Add(new ReportParameter("SaldoAwal", _SaldoAwal.ToString()));
                    rptParams.Add(new ReportParameter("SaldoAwalORI", _SaldoAwalORI.ToString()));

                    frmReportViewer ifrmReport = new frmReportViewer("Laporan.Finance.rptRekonBank2.rdlc", rptParams, dt, "dsRekonBank_usp_RekonBank_REPORT");
                    ifrmReport.Show();
                }
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int    intVtype = 0, intDetails = 0, intnaration = 0, intSP = 0;
            string strRefNo = "", strMpoComm = "", strbranchID = "", strHeading = "";
            string strPFdate = "", strPTdate = "", strPMonthID = "";

            if (radSp.Checked == true)
            {
                intSP = 1;
            }
            else
            {
                intSP = 0;
            }
            if (radPayment.Checked == true)
            {
                intVtype   = (int)Utility.VOUCHER_TYPE.vtPAYMENT_VOUCHER;
                strHeading = "Payment";
            }
            else if (radReceipt.Checked == true)
            {
                intVtype   = (int)Utility.VOUCHER_TYPE.vtRECEIPT_VOUCHER;
                strHeading = "Receipt";
            }
            else if (radJournal.Checked == true)
            {
                intVtype   = (int)Utility.VOUCHER_TYPE.vtJOURNAL_VOUCHER;
                strHeading = "Journal";
            }
            else if (radContra.Checked == true)
            {
                intVtype   = (int)Utility.VOUCHER_TYPE.vtCONTRA_VOUCHER;
                strHeading = "Contra";
            }
            else if (radSp.Checked == true && chkboxMPOComm.Checked == false)
            {
                intVtype   = (int)Utility.VOUCHER_TYPE.vtJOURNAL_VOUCHER;
                strHeading = "MPO Commission1";
            }
            else if (radSp.Checked == true && chkboxMPOComm.Checked == true)
            {
                intVtype   = (int)Utility.VOUCHER_TYPE.vtJOURNAL_VOUCHER;
                strHeading = "MPO Commission";
            }
            if (chkNarration.Checked == true)
            {
                intnaration = 1;
            }
            if (radDetails.Checked == true)
            {
                intDetails = 2;
            }
            else
            {
                intDetails = 0;
            }
            if (radIndividual.Checked == true)
            {
                if (textBox1.Text == "")
                {
                    MessageBox.Show("Voucher No cannot be Empty");
                    uctxtVoucherNo.Focus();
                    return;
                }
                strRefNo   = textBox1.Text;
                intDetails = 1;
                if (chkboxMPOComm.Checked == true)
                {
                    strMpoComm = "MCInduvidual";
                }
                else
                {
                    strMpoComm = "";
                }
            }
            else
            {
                strRefNo = "";
            }
            if (strHeading != "MPO Commission")
            {
                strPFdate   = Utility.FirstDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("dd-MM-yyyy");
                strPTdate   = Utility.LastDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("dd-MM-yyyy");
                strPMonthID = Utility.FirstDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("MMMyy");

                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.AccountsVoucher;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.intSummDetails   = intDetails;
                frmviewer.intVtype         = intVtype;
                frmviewer.intNarration     = intnaration;
                frmviewer.strString        = strRefNo;
                frmviewer.strBranchID      = strbranchID;
                frmviewer.strHeading       = strHeading;
                frmviewer.strPreviousFDate = strPFdate;
                frmviewer.strPreviousTDate = strPTdate;
                frmviewer.intSP            = intSP;
                frmviewer.Show();
            }
            else
            {
                frmReportViewer frmviewer = new frmReportViewer();
                if (strMpoComm == "MCInduvidual")
                {
                    strPFdate                       = Utility.FirstDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("dd-MM-yyyy");
                    strPTdate                       = Utility.LastDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("dd-MM-yyyy");
                    strPMonthID                     = Utility.FirstDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("MMMyy");
                    frmviewer.selector              = ViewerSelector.JVSP;
                    frmviewer.strFdate              = strPFdate;
                    frmviewer.strTdate              = strPTdate;
                    frmviewer.strPMonthID           = strPMonthID;
                    frmviewer.intSummDetails        = intDetails;
                    frmviewer.intVtype              = intVtype;
                    frmviewer.intNarration          = intnaration;
                    frmviewer.strString             = strRefNo;
                    frmviewer.strBranchID           = strbranchID;
                    frmviewer.strHeading            = strHeading;
                    frmviewer.ReportSecondParameter = "A";
                    frmviewer.strSelf               = "MC";
                    frmviewer.intSP                 = intSP;
                    frmviewer.Show();
                }
                else
                {
                    strPFdate             = Utility.FirstDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("dd-MM-yyyy");
                    strPTdate             = Utility.LastDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("dd-MM-yyyy");
                    strPMonthID           = Utility.FirstDayOfMonth(dteFromDate.Value.AddMonths(-1)).ToString("MMMyy");
                    frmviewer.selector    = ViewerSelector.MpoCommissionSP;
                    frmviewer.strPFdate   = strPFdate;
                    frmviewer.strPTdate   = strPTdate;
                    frmviewer.strPMonthID = strPMonthID;
                    frmviewer.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");

                    frmviewer.intSummDetails        = intDetails;
                    frmviewer.intVtype              = intVtype;
                    frmviewer.intNarration          = intnaration;
                    frmviewer.strString             = strRefNo;
                    frmviewer.strBranchID           = strbranchID;
                    frmviewer.strHeading            = strHeading;
                    frmviewer.strPreviousFDate      = strPFdate;
                    frmviewer.strPreviousTDate      = strPTdate;
                    frmviewer.ReportSecondParameter = "A";
                    frmviewer.strSelf = "MC";
                    frmviewer.intSP   = intSP;
                    frmviewer.Show();
                }
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strBrachID   = "";
            int    intselection = 0;

            if (uctxtLedgerName.Text == "")
            {
                MessageBox.Show("Name Cannot be Empty");
                uctxtLedgerName.Focus();
                return;
            }

            //1 =opn + tran +clos
            //2 opn +tran;3 opn + clos;4 tran + opn;5 tran + opn,6 =cls + opn,7 cls + tran 8 =opn, 9 tran 10 cls;
            if (chkOpening.Checked == true && chkTransaction.Checked == true && chkClosing.Checked == true)
            {
                intselection = 1;
            }
            else if (chkOpening.Checked == true && chkTransaction.Checked)
            {
                intselection = 2;
            }
            else if (chkOpening.Checked == true && chkClosing.Checked)
            {
                intselection = 3;
            }
            else if (chkTransaction.Checked == true && chkClosing.Checked == true)
            {
                intselection = 4;
            }
            else if (chkTransaction.Checked == true && chkOpening.Checked == true)
            {
                intselection = 5;
            }
            else if (chkClosing.Checked == true && chkOpening.Checked == true)
            {
                intselection = 6;
            }
            else if (chkClosing.Checked == true && chkTransaction.Checked == true)
            {
                intselection = 7;
            }
            else if (chkOpening.Checked == true && chkTransaction.Checked == false && chkClosing.Checked == false)
            {
                intselection = 8;
            }
            else if (chkOpening.Checked == false && chkTransaction.Checked == true && chkClosing.Checked == false)
            {
                intselection = 9;
            }
            else if (chkOpening.Checked == false && chkTransaction.Checked == false && chkClosing.Checked == true)
            {
                intselection = 10;
            }
            else
            {
                intselection = 1;
            }

            frmReportViewer frmviewer = new frmReportViewer();

            frmviewer.selector       = ViewerSelector.Group;
            frmviewer.strFdate       = dteFromDate.Text;
            frmviewer.strTdate       = dteToDate.Text;
            frmviewer.strString      = uctxtLedgerName.Text;
            frmviewer.strBranchID    = strBrachID;
            frmviewer.intSummDetails = intselection;
            if (radGroupWise.Checked == true)
            {
                frmviewer.strSelction = "Group";
                frmviewer.strHeading  = "Group Summary";
            }
            else
            {
                frmviewer.strSelction = "Ledger";
                frmviewer.strHeading  = "Group Summary (Ledger)";
            }

            frmviewer.strHeading = uctxtLedgerName.Text;
            frmviewer.Show();
        }
示例#14
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strBranchName = "";
            //1=Group,3=gropParent,2=primary
            string strBranchId = "";
            int    intStatus   = 0;

            if (uctxtBranch.Text == "")
            {
                MessageBox.Show("Please Select Branch Name.");
                return;
            }
            else
            {
                strBranchName = "Branch : " + uctxtBranch.Text;
                strBranchId   = Utility.gstrGetBranchID(strComID, uctxtBranch.Text);
            }
            if (radIndividual.Checked == true)
            {
                if (uctxtLedgerConfig.Text == "")
                {
                    MessageBox.Show("Please Select Leger Group.");
                    return;
                }
            }
            if (radActive.Checked == true)
            {
                intStatus = 0;
            }
            else if (radInactive1.Checked == true)
            {
                intStatus = 1;
            }
            else
            {
                intStatus = 2;
            }

            if ((radGroupwise.Checked == true) && (radIndividual.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.MpoList;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.strString        = uctxtLedgerConfig.Text;
                frmviewer.secondParameter1 = strBranchName;
                frmviewer.intMode          = 1;
                frmviewer.reportTitle2     = "A";
                frmviewer.intStatus        = intStatus;
                frmviewer.Show();
            }
            if ((radAll.Checked == true) && (rbtnClass.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.rptMpoListLedgerWAll;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.secondParameter1 = strBranchName;
                frmviewer.strSelction      = "Class";
                frmviewer.reportTitle2     = "A";
                frmviewer.intSuppress2     = 1;
                frmviewer.intStatus        = intStatus;
                frmviewer.Show();
            }
            if ((radIndividual.Checked == true) && (rbtnClass.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.rptMpoListLedgerWAll;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.secondParameter1 = strBranchName;
                frmviewer.strString        = uctxtLedgerConfig.Text;
                frmviewer.strSelction      = "Class";
                frmviewer.reportTitle2     = "A";
                frmviewer.intSuppress2     = 1;
                frmviewer.intStatus        = intStatus;
                frmviewer.Show();
            }
            if ((radAll.Checked == true) && (rbtnRoute.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.rptMpoListLedgerWAll;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.secondParameter1 = strBranchName;
                frmviewer.reportTitle2     = "A";
                frmviewer.strSelction      = "Route";
                frmviewer.intMode          = 8;
                frmviewer.intSuppress2     = 1;
                frmviewer.intStatus        = intStatus;
                frmviewer.Show();
            }
            if ((radIndividual.Checked == true) && (rbtnRoute.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.rptMpoListLedgerWAll;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.secondParameter1 = strBranchName;
                frmviewer.strString        = uctxtLedgerConfig.Text;
                frmviewer.reportTitle2     = "A";
                frmviewer.strSelction      = "Route";
                frmviewer.intMode          = 8;
                frmviewer.intSuppress2     = 1;
                frmviewer.intStatus        = intStatus;
                frmviewer.Show();
            }
            if ((radLedgerW.Checked == true) && (radIndividual.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.MpoList;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.strString        = uctxtLedgerConfig.Text;
                frmviewer.secondParameter1 = strBranchName;
                frmviewer.intMode          = 3;
                frmviewer.reportTitle2     = "A";
                frmviewer.intStatus        = intStatus;
                frmviewer.Show();
            }

            if ((radGroupwise.Checked == true) && (radAll.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.MpoList;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.secondParameter1 = strBranchName;
                frmviewer.reportTitle2     = "A";
                frmviewer.intStatus        = intStatus;
                frmviewer.Show();
            }
            if ((radLedgerW.Checked == true) && (radAll.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector         = ViewerSelector.rptMpoListLedgerWAll;
                frmviewer.strFdate         = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate         = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strBranchId      = strBranchId;
                frmviewer.secondParameter1 = strBranchName;
                frmviewer.reportTitle2     = "A";
                frmviewer.intStatus        = intStatus;
                frmviewer.Show();
            }
        }
示例#15
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strBrachID = "";
            int    intInactive = 0, intReportStatus = 0;

            if (cboxOnlyAccounts.Checked == true)
            {
                intReportStatus = 1;
            }
            else
            {
                intReportStatus = 0;
            }
            if (chkStatus.Checked == true)
            {
                intInactive = 1;
            }
            else
            {
                intInactive = 0;
            }

            if (uctxtBranchName.Text == "")
            {
                MessageBox.Show("Branch Name Cannot be Empty");
                uctxtBranchName.Focus();
                return;
            }
            if (uctxtLedgerConfig.Visible && radIndividual.Checked == true)
            {
                if (uctxtLedgerConfig.Text == "")
                {
                    MessageBox.Show("Party Name Cannot be Empty");
                    uctxtLedgerConfig.Focus();
                    return;
                }
            }

            strBrachID = Utility.gstrGetBranchID(strComID, uctxtBranchName.Text);;
            if (strReportName == "Daily Collection")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector       = ViewerSelector.DailyCollection;
                frmviewer.mstrBranchName = uctxtBranchName.Text;
                frmviewer.strFdate       = dteFromDate.Text;
                frmviewer.strTdate       = dteToDate.Text;
                frmviewer.strBranchID    = strBrachID;
                frmviewer.intSP          = intReportStatus;
                frmviewer.strHeading     = "Daily Collection";
                frmviewer.Show();
            }

            else if (strReportName == "Contract Bill")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.ContactPartyBill;
                frmviewer.strFdate    = dteFromDate.Text;
                frmviewer.strTdate    = dteToDate.Text;
                frmviewer.strString   = uctxtLedgerConfig.Text;
                frmviewer.strBranchID = strBrachID;
                frmviewer.strHeading  = "Contract Party Bill";
                frmviewer.Show();
            }
            else if (strReportName == "Contract Party Bill")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector       = ViewerSelector.ContactPartyBill2;
                frmviewer.strFdate       = dteFromDate.Text;
                frmviewer.strTdate       = dteToDate.Text;
                frmviewer.strString      = uctxtLedgerConfig.Text;
                frmviewer.strBranchID    = strBrachID;
                frmviewer.mstrBranchName = uctxtBranchName.Text;
                frmviewer.strHeading     = "Contract Party Bill(1)";
                frmviewer.Show();
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strBranchId = "", strString = "";
            int    inttype = 1, intAlias = 0;

            if (radItem.Checked == true)
            {
                intAlias = 0;
            }
            else
            {
                intAlias = 1;
            }
            if (uctxtBranchName.Text == "")
            {
                MessageBox.Show("Branch Name Cannot be Empty");
                uctxtBranchName.Focus();
                return;
            }
            if (lstRight.Items.Count == 0)
            {
                for (int i = 0; i < lstLeft.Items.Count; i++)
                {
                    strString = strString + "'" + lstLeft.Items[i].ToString() + "',";
                }
                if (strString != "")
                {
                    strString = Utility.Mid(strString, 0, strString.Length - 1);
                }
            }
            else
            {
                for (int i = 0; i < lstRight.Items.Count; i++)
                {
                    strString = strString + "'" + lstRight.Items[i].ToString() + "',";
                }
                if (strString != "")
                {
                    strString = Utility.Mid(strString, 0, strString.Length - 1);
                }
            }
            strBranchId = Utility.gstrGetBranchID(strComID, uctxtBranchName.Text);
            if (strName == "I")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.StockIPrice;
                frmviewer.strString   = strString;
                frmviewer.strBranchID = strBranchId;
                frmviewer.strFdate    = dteFromDate.Text;
                frmviewer.strTdate    = dteToDate.Text;
                frmviewer.strSelction = "I";
                frmviewer.strGroup    = cboGroupName.Text;
                frmviewer.intSorting  = intAlias;
                frmviewer.Show();
            }
            else if (strName == "S" || strName == "Su")
            {
                if (radProductWise.Checked == true)
                {
                    inttype = 1;
                }
                else if (radPackSize.Checked == true)
                {
                    inttype = 2;
                }
                else
                {
                    inttype = 3;
                }
                if (strString == "")
                {
                    MessageBox.Show("Select the Item First");
                    return;
                }
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.StockStatement;
                frmviewer.strString   = strString;
                frmviewer.strBranchID = strBranchId;
                frmviewer.strFdate    = dteFromDate.Text;
                frmviewer.strTdate    = dteToDate.Text;
                frmviewer.intype      = inttype;
                frmviewer.strSelction = strName;
                frmviewer.intSorting  = intAlias;
                frmviewer.Show();
            }
            else if (strName == "P")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.StockIPrice;
                frmviewer.strString   = strString;
                frmviewer.strBranchID = strBranchId;
                frmviewer.strFdate    = dteFromDate.Text;
                frmviewer.strTdate    = dteToDate.Text;
                frmviewer.strSelction = "O";
                frmviewer.intSorting  = intAlias;
                frmviewer.Show();
            }
        }
示例#17
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string VouMode              = "";
            string VouType              = "";
            string LedgerePurchase      = "";
            int    suppressProducttotal = 0;
            int    suppressPartytotal   = 0;

            if (cheSupPartyT.Checked == true)
            {
                suppressPartytotal = 1;
            }
            if (cheSupPartyT.Enabled == false)
            {
                suppressPartytotal = 1;
            }
            if (ChkboxProdkuctTotal.Checked == true)
            {
                suppressProducttotal = 2;
            }
            if (ChkboxProdkuctTotal.Enabled == false)
            {
                suppressProducttotal = 2;
            }

            if (strReportName == "Purchase")
            {
                LedgerePurchase = "Purchase";
                if (cmbTranType.Text == "Purchase Invoice")
                {
                    VouType = "33";
                }
                else if (cmbTranType.Text == "Purchase Return")
                {
                    VouType = "32";
                }
                else if (cmbTranType.Text == "Receive Inventory")
                {
                    VouType = "12";
                }
            }
            if (strReportName == "Sales")
            {
                LedgerePurchase = "Sales";
                if (cmbTranType.Text == "Sales Invoice")
                {
                    VouType = "16";
                }
                else if (cmbTranType.Text == "Sales Chalan")
                {
                    VouType = "15";
                }
                else if (cmbTranType.Text == "Sales Return")
                {
                    VouType = "13";
                }
            }
            string strString = "";

            if (radSelection.Checked == true)
            {
                if (lstLeft2.Items.Count <= 0)
                {
                    MessageBox.Show("Data Not Found.");
                    return;
                }
            }
            {
                for (int i = 0; i < lstLeft2.Items.Count; i++)
                {
                    strString = strString + "'" + lstLeft2.Items[i].ToString().Replace("'", "''") + "',";
                }
                if (strString != "")
                {
                    strString = Utility.Mid(strString, 0, strString.Length - 1);
                }
            }

            string strString2 = "";

            if (radSelection.Checked == true)
            {
                if (lstRight2.Items.Count <= 0)
                {
                    MessageBox.Show("Data Not Found.");
                    return;
                }
            }
            {
                for (int i = 0; i < lstRight2.Items.Count; i++)
                {
                    strString2 = strString2 + "'" + lstRight2.Items[i].ToString().Replace("'", "''") + "',";
                }
                if (strString2 != "")
                {
                    strString2 = Utility.Mid(strString2, 0, strString2.Length - 1);
                }
            }
            if ((radPartyW.Checked == true) && (radItemwiseSum.Checked == true) && (radall.Checked == true) && (cheSupPartyT.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.intMode      = 2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }

            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (radSelection.Checked == true) && (ChkboxProdkuctTotal.Checked == true) && (cheSupPartyT.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();

                frmviewer.selector = ViewerSelector.PartyWiseProductWise;

                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intMode      = 3;
                frmviewer.intSuppress  = 10;
                frmviewer.strString3   = strString2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }
            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (radSelection.Checked == true) && (cheSupPartyT.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                if (textBox1.Text == "Led")
                {
                    frmviewer.selector = ViewerSelector.PartyWiseProductWise;
                }
                if (textBox1.Text == "Item")
                {
                    frmviewer.selector = ViewerSelector.PartyWiseProductWise2;
                }
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.strString3   = strString2;
                frmviewer.intSuppress  = 8;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 3;
                frmviewer.Show();
                return;
            }
            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (radSelection.Checked == true) && (ChkboxProdkuctTotal.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();

                frmviewer.selector = ViewerSelector.PartyWiseProductWise;

                frmviewer.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction = VouType;
                frmviewer.strString2  = LedgerePurchase;
                frmviewer.strString   = strString;
                frmviewer.intMode     = 3;
                frmviewer.intSuppress = 9;
                //frmviewer.intMode = suppress2;
                frmviewer.strString3   = strString2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }
            if ((radPartyW.Checked == true) && (radItemwiseSum.Checked == true) && (radSelection.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.strString3   = strString2;
                frmviewer.intMode      = 2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }
            if ((radProductW.Checked == true) && (radItemWDet.Checked == true) && (radSelection.Checked == true) && (cheSupPartyT.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.strString3   = strString2;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 6;
                frmviewer.Show();
                return;
            }
            if ((radProductW.Checked == true) && (radItemwiseSum.Checked == true) && (radSelection.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.strString3   = strString2;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 4;
                frmviewer.Show();
                return;
            }

            if ((radProductW.Checked == true) && (radItemWDet.Checked == true) && (radSelection.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.strString3   = strString2;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 6;
                frmviewer.Show();
                return;
            }


            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (ChkboxProdkuctTotal.Checked == true) && (cheSupPartyT.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();

                frmviewer.selector = ViewerSelector.PartyWiseProductWise;

                frmviewer.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction = VouType;
                frmviewer.strString2  = LedgerePurchase;
                frmviewer.strString   = strString;
                frmviewer.intMode     = 3;
                frmviewer.intSuppress = 10;
                //frmviewer.intMode = suppress2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }

            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (cheSupPartyT.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();

                frmviewer.selector = ViewerSelector.PartyWiseProductWise;

                frmviewer.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction = VouType;
                frmviewer.strString2  = LedgerePurchase;
                frmviewer.strString   = strString;
                frmviewer.strString3  = strString2;
                frmviewer.intMode     = 3;
                frmviewer.intSuppress = 8;
                //frmviewer.intMode = suppress2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }
            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (ChkboxProdkuctTotal.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();

                frmviewer.selector = ViewerSelector.PartyWiseProductWise;

                frmviewer.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction = VouType;
                frmviewer.strString2  = LedgerePurchase;
                frmviewer.strString   = strString;
                frmviewer.intMode     = 3;
                frmviewer.intSuppress = 9;
                //frmviewer.intMode = suppress2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }

            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (radall.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction = VouType;
                frmviewer.strString2  = LedgerePurchase;
                frmviewer.strString   = strString;
                frmviewer.intMode     = 3;
                //frmviewer.intSuppress = suppress;
                //frmviewer.intMode = suppress2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }


            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (radSelection.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction = VouType;
                frmviewer.strString2  = LedgerePurchase;
                frmviewer.strString   = strString;
                frmviewer.strString3  = strString2;
                frmviewer.intMode     = 3;
                //frmviewer.intSuppress = suppress;
                //frmviewer.intMode = suppress2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }

            //if ((radProductW.Checked == true) && (radItemWDet.Checked == true) && (radSelection.Checked == true))
            //{
            //    frmReportViewer frmviewer = new frmReportViewer();
            //    if (textBox1.Text == "Led")
            //    {
            //        frmviewer.selector = ViewerSelector.PartyWiseProductWise;
            //    }
            //    if (textBox1.Text == "Item")
            //    {
            //        frmviewer.selector = ViewerSelector.PartyWiseProductWise2;
            //    }
            //    frmviewer.strFdate = dteFromDate.Value.ToString("dd-MM-yyyy");
            //    frmviewer.strTdate = dteToDate.Value.ToString("dd-MM-yyyy");
            //    frmviewer.strSelction = VouType;
            //    frmviewer.strString2 = LedgerePurchase;
            //    frmviewer.strString = strString;
            //    frmviewer.intSuppress = suppress;
            //    frmviewer.reportTitle2 = "A";
            //    frmviewer.intMode = 3;
            //    frmviewer.Show();
            //    return;
            //}
            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (radall.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                if (textBox1.Text == "Led")
                {
                    frmviewer.selector = ViewerSelector.PartyWiseProductWise;
                }
                if (textBox1.Text == "Item")
                {
                    frmviewer.selector = ViewerSelector.PartyWiseProductWise2;
                }
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 3;
                frmviewer.Show();
                return;
            }
            //cheSupPartyT



            if ((radPartyW.Checked == true) && (radItemWDet.Checked == true) && (radall.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate = dteToDate.Value.ToString("dd-MM-yyyy");
                //frmviewer.intSuppress = suppress;
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 1;
                frmviewer.Show();
                return;
            }
            if ((radPartyW.Checked == true) && (radItemwiseSum.Checked == true) && (radall.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.intMode      = 2;
                frmviewer.reportTitle2 = "A";
                frmviewer.Show();
                return;
            }

            if ((radPartyW.Checked == true) && (radItemwiseSum.Checked == true) && (radall.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 2;
                frmviewer.Show();
                return;
            }
            if ((radProductW.Checked == true) && (radItemWDet.Checked == true) && (radall.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 6;
                frmviewer.Show();
                return;
            }
            if ((radProductW.Checked == true) && (radItemwiseSum.Checked == true) && (radall.Checked == true))
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector     = ViewerSelector.PartyWiseProductWise;
                frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                frmviewer.strSelction  = VouType;
                frmviewer.strString2   = LedgerePurchase;
                frmviewer.strString    = strString;
                frmviewer.intSuppress  = suppressPartytotal;
                frmviewer.intSuppress2 = suppressProducttotal;
                frmviewer.reportTitle2 = "A";
                frmviewer.intMode      = 4;
                frmviewer.Show();
                return;
            }
        }
示例#18
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int    intsumDet = 0, intSorting = 0, intwithoutFac = 0;
            string strString = "", strPayYearly = "";

            if (radDetails.Checked == true)
            {
                intsumDet = 1;
            }
            else if (radSumm.Checked == true)
            {
                intsumDet = 0;
            }
            else if (rbtMonthly.Checked == true)
            {
                intsumDet = 3;
            }
            else if (rbtYearly.Checked == true)
            {
                intsumDet = 2;
            }


            if (chkSorting.Checked == true)
            {
                intSorting = 1;
            }
            else
            {
                intSorting = 0;
            }
            if (strReportName == "Cash Flow")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector       = ViewerSelector.CashFlow;
                frmviewer.strFdate       = dteFromDate.Text;
                frmviewer.strTdate       = dteToDate.Text;
                frmviewer.strSelction    = "Cash Flow";
                frmviewer.intSummDetails = intsumDet;

                frmviewer.Show();
            }
            else if (strReportName == "Manufacturing")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.Manufacturing;
                frmviewer.strFdate    = dteFromDate.Text;
                frmviewer.strTdate    = dteToDate.Text;
                frmviewer.strSelction = "Manufacturing";
                frmviewer.Show();
            }
            else if (strReportName == "Cheque Payment")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.Cheque;
                frmviewer.strFdate    = dteFromDate.Text;
                frmviewer.strTdate    = dteToDate.Text;
                frmviewer.strSelction = "Cheque";
                frmviewer.intSP       = intSorting;
                frmviewer.Show();
            }
            else if (strReportName == "Special Commission")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                if (chkboxCoulamAutoGenaret.Checked == true)
                {
                    frmviewer.selector = ViewerSelector.SP;
                }
                else
                {
                    frmviewer.selector = ViewerSelector.SP2;
                }
                frmviewer.strFdate    = dteFromDate.Text;
                frmviewer.strTdate    = dteToDate.Text;
                frmviewer.strSelction = "SP";
                frmviewer.Show();
            }

            else if (strReportName == "Payment Summary")
            {
                if (chkboxWfactory.Checked == true)
                {
                    intwithoutFac = 1;
                }
                else
                {
                    intwithoutFac = 0;
                }

                if (rbtYearly.Checked == true)
                {
                    if (lstRight.Items.Count <= 0)
                    {
                        MessageBox.Show("Data Not Found.");
                        return;
                    }
                    {
                        if (lstRight.Items.Count > 2)
                        {
                            MessageBox.Show("You can Maximum two Company selected");
                            lstRight.Focus();
                            return;
                        }
                        if (lstRight.Items.Count > 0)
                        {
                            lstRight.Sorted = true;
                            for (int i = 0; i < lstRight.Items.Count; i++)
                            {
                                strString = lstRight.Items[i].ToString().Replace("'", "''");

                                strPayYearly = objwois.minsertPaymentSummaryYearly(strComID, strString, i, intwithoutFac);
                            }
                            if (strString != "")
                            {
                                strString = Utility.Mid(strString, 0, strString.Length - 1);
                            }
                        }
                    }
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector       = ViewerSelector.ExpenseSummYearly;
                    frmviewer.strSelction    = "Payment Summary(Yearly)";
                    frmviewer.intSummDetails = intsumDet;
                    frmviewer.intHor_ver     = intwithoutFac;
                    frmviewer.Show();
                }
                else if (rbtMonthly.Checked == true)
                {
                    string strString2 = "";

                    for (int i = 0; i < lstRight.Items.Count; i++)
                    {
                        strString2 = lstRight.Items[i].ToString().Replace("'", "''");

                        string sddd = orptCnn.mGetPaymentSummaryMonthly(strComID, comboBox1.Text, intwithoutFac, strString2, i);
                    }
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector       = ViewerSelector.ExpenseSummMonthly;
                    frmviewer.strString      = comboBox1.Text;
                    frmviewer.strTdate       = dteToDate.Text;
                    frmviewer.strSelction    = "Payment Summary(Monthly)";
                    frmviewer.intSummDetails = intsumDet;
                    frmviewer.intHor_ver     = intwithoutFac;
                    frmviewer.strString3     = strString2;
                    frmviewer.Show();
                }
                else
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector       = ViewerSelector.ExpenseSumm;
                    frmviewer.strFdate       = dteFromDate.Text;
                    frmviewer.strTdate       = dteToDate.Text;
                    frmviewer.strSelction    = "Payment Summary";
                    frmviewer.intSummDetails = intsumDet;
                    frmviewer.Show();
                }
            }
            else if (strReportName == "ERP Statistics")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector    = ViewerSelector.Statistics;
                frmviewer.strFdate    = dteFromDate.Text;
                frmviewer.strTdate    = dteToDate.Text;
                frmviewer.strSelction = "ERP Statistics";
                frmviewer.Show();
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strBranchId = "", strString2 = "";
            int    intmode = 0, intSalesCollAch = 0;

            intSalesCollAch = 1;


            if (rbtnAll.Checked == true)
            {
                intmode = 5;
            }
            if (rbtnMPO.Checked == true)
            {
                intmode = 4;
            }
            if (rbtnAMFM.Checked == true)
            {
                intmode = 3;
            }
            if (rbtnDSMRSM.Checked == true)
            {
                intmode = 2;
            }
            if (rbtnZONE.Checked == true)
            {
                intmode = 1;
            }

            if (uctxtBranch.Text == "")
            {
                MessageBox.Show("Please Select Branch Name.");
                return;
            }
            else
            {
                strBranchId = Utility.gstrGetBranchID(strComID, uctxtBranch.Text);
            }


            if (rbtnAll.Checked != true)
            {
                if (lstRight.Items.Count <= 0)
                {
                    MessageBox.Show("Data Not Found.");
                    return;
                }
            }


            for (int i = 0; i < lstRight.Items.Count; i++)
            {
                strString2 = strString2 + "'" + lstRight.Items[i].ToString().Replace("'", "''") + "',";
            }
            if (strString2 != "")
            {
                strString2 = Utility.Mid(strString2, 0, strString2.Length - 1);
            }

            frmReportViewer frmviewer = new frmReportViewer();

            frmviewer.selector         = ViewerSelector.CPSPSalescollPer;
            frmviewer.intMode          = intmode;
            frmviewer.strString2       = strString2;
            frmviewer.strFdate         = dteFCurrentYear.Text;
            frmviewer.strTdate         = dteTCurrentYear.Text;
            frmviewer.strFPreviousdate = dteFPreviousYear.Text;
            frmviewer.strTPreviousdate = dteTPreviousYear.Text;
            frmviewer.strOldComID      = txtOldcomID.Text;
            frmviewer.strBranchId      = strBranchId;
            frmviewer.intMode          = intmode;
            frmviewer.intStatus        = intSalesCollAch;
            frmviewer.secondParameter1 = uctxtBranch.Text;
            frmviewer.reportTitle2     = "A";
            frmviewer.Show();
        }
示例#20
0
        void tsmi_Click(object sender, EventArgs e)
        {
            ToolStripButton btnActivity = sender as ToolStripButton;
            string          id          = btnActivity.Name;

            this.Text = btnActivity.Text;

            switch (Text)
            {
            case "Reg and Invoice":
                showChildForms(new CIS.Modules.CISViewRegAndInvoice());
                break;

            case "Inventory Manage":
                showChildForms(new CIS.Modules.cisViewAndAdjustStockByItem());
                break;

            case "Purchase":
                showChildForms(new CIS.Modules.CISViewPurchaseReceipt());
                break;

            case "Transfer Patient":
                CIS.Modules.cisTransferPatient objShowTP = new CIS.Modules.cisTransferPatient();
                objShowTP.ShowDialog();
                break;

            case "Discharge Patient":
                CIS.Modules.cisDischargePatient objShowDP = new CIS.Modules.cisDischargePatient();
                objShowDP.ShowDialog();
                break;

            case "View Bill Info":
                showChildForms(new CIS.Modules.cisViewBillDetails());
                break;

            case "Cancel Visit and Bill":
                CIS.Modules.cisCancelVisitAndBill objShowCVB = new CIS.Modules.cisCancelVisitAndBill();
                objShowCVB.ShowDialog();
                break;

            case "Inventory Movements":
                showChildForms(new CIS.Modules.cisViewInventoryMovements());
                break;

            case "Deposits Transaction":
                showChildForms(new CIS.Modules.cisViewAdvanceCollection());
                break;

            case "Ward Bill":
                showChildForms(new CIS.Modules.cisViewWardBill());
                break;

            case "Reports":
                frmReportViewer frmReportViewer = new frmReportViewer();
                frmReportViewer.Show();
                break;

            case "Department":
                showChildForms(new frmViewDepartment());
                break;

            case "Patient Type":
                showChildForms(new Master.frmViewPatientType());
                break;

            case "Doctor":
                showChildForms(new Master.frmViewDoctor());
                break;

            case "Address Info":
                showChildForms(new Master.frmViewAddressInfo());
                break;

            case "Corporate":
                showChildForms(new Master.frmViewCorporate());
                break;

            case "Room and Bed":
                showChildForms(new Master.frmRoom());
                break;

            case "Define Reg Fee":
                showChildForms(new Master.frmViewDefineRegFee());
                break;

            case "Pharmacy Master":
                showChildForms(new Master.cisPharmacyMaster());
                break;

            case "Investigation Master":
                showChildForms(new Master.cisInvestigationMaster());
                break;

            case "Account Master":
                showChildForms(new CIS.Master.cis_account_head());
                break;

            case "Category":
                showChildForms(new CIS.Laboratory.frmLoadLabData("Category"));
                break;

            case "Test Field":
                showChildForms(new CIS.Laboratory.frmLoadLabData("TestField"));
                break;

            case "Map Test Fields":
                CIS.Laboratory.Master.frmTestFieldMapping objForm = new Laboratory.Master.frmTestFieldMapping();
                objForm.Show();
                break;

            case "Result Entry":
                showChildForms(new CIS.Laboratory.frmResultEntryView());
                break;

            case "View Lab Bill":
                showChildForms(new CIS.Laboratory.frmViewLabBillInfo());
                break;

            case "User Role":
                showChildForms(new CIS.Laboratory.frmLoadLabData("UserRole"));
                break;

            case "User":
                showChildForms(new CIS.Laboratory.frmLoadLabData("User"));
                break;

            case "User Rights":
                CIS.Laboratory.User.frmUserMapping objForm1 = new Laboratory.User.frmUserMapping();
                objForm1.Show();
                break;

            case "Printer Setting":
                showChildForms(new CIS.Laboratory.frmLoadLabData("PrinterSetting"));
                break;

            case "Corporate Due List":
                showChildForms(new CIS.Master.frmCorporateDueList());
                break;

            case "Referral":
                showChildForms(new CIS.Master.frmViewReferral());
                break;

            case "Discharge Summary":
                showChildForms(new CIS.Laboratory.frmLoadLabData("DischargeSummary"));
                break;

            default:
                break;
            }
        }
示例#21
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string   strmsg = "", strName = "All", strString = "";
            int      intMode = 0, intSelection = 0, intBaseTarget = 0;
            double   dblcls = 0;
            DateTime dteLedgerFdate;
            string   strLedgerTDate = "";

            progressBar1.Value = 0;
            ReportOption();
            if (cboCompanyID.Text == "")
            {
                MessageBox.Show("Company ID Cannot be Empty");
                cboCompanyID.Focus();
                return;
            }
            if (txtLedgerType.Text != "All")
            {
                strName = txtLedgerType.Text.Substring(0, 1);
            }
            if (chkBaseTarget.Checked == true)
            {
                intBaseTarget = 1;
            }
            else
            {
                intBaseTarget = 0;
            }
            if (lstRight.Items.Count > 0)
            {
                for (int i = 0; i < lstRight.Items.Count; i++)
                {
                    strString = strString + "'" + lstRight.Items[i].ToString() + "',";
                }
                if (strString != "")
                {
                    strString = Utility.Mid(strString, 0, strString.Length - 1);
                }
            }
            if (txtLedgerType.Text == "AM/FM")
            {
                intSelection = 1;
            }
            if (txtLedgerType.Text == "DSM/RSM")
            {
                intSelection = 2;
            }
            if (txtLedgerType.Text == "Zone")
            {
                intSelection = 3;
            }
            if (txtLedgerType.Text == "All")
            {
                intSelection = 0;
            }



            progressBar2.Value = 0;
            string gg = objExtra.mDeletePerformanve(strComID);

            List <AccountsLedger> objLedger = accms.mFillLedgerSelectionProjection(strComID, 202, strName, strString, Utility.gstrUserName, intReportOption).ToList();

            if (objLedger.Count > 0)
            {
                progressBar1.Maximum = objLedger.Count;
                if (intSelection == 0)
                {
                    progressBar2.Value   = 0;
                    progressBar2.Maximum = objLedger.Count;
                }
                foreach (AccountsLedger ooLedger in objLedger)
                {
                    if (intSelection == 0)
                    {
                        dteLedgerFdate = dteFromDate.Value;

                        for (int imonth = 1; imonth <= 12; imonth++)
                        {
                            strLedgerTDate = Utility.LastDayOfMonth(dteLedgerFdate).ToString("dd-MM-yyyy");
                            dblcls         = Math.Round(Utility.dblLedgerOpBalanceNew(strComID, dteLedgerFdate.ToString("dd-MM-yyyy"), strLedgerTDate, ooLedger.strLedgerName, "0001"), 2) * -1;
                            string i = Utility.mInsertLedgerOthers(strComID, ooLedger.strLedgerName, imonth, dblcls);
                            dteLedgerFdate = dteLedgerFdate.AddMonths(1);
                        }
                        progressBar2.Value += 1;
                    }
                    else if (intSelection == 1)
                    {
                        progressBar2.Value = 0;
                        List <AccountsLedger> objArea = accms.mFillLedgerSelectionProjection(strComID, 202, "K", strString, Utility.gstrUserName, intReportOption).ToList();
                        progressBar2.Maximum = objArea.Count;
                        foreach (AccountsLedger ooArea in objArea)
                        {
                            dteLedgerFdate = dteFromDate.Value;
                            for (int imonth = 1; imonth <= 12; imonth++)
                            {
                                strLedgerTDate = Utility.LastDayOfMonth(dteLedgerFdate).ToString("dd-MM-yyyy");
                                dblcls         = Math.Round(Utility.dblLedgerOpBalanceNew(strComID, dteLedgerFdate.ToString("dd-MM-yyyy"), strLedgerTDate, ooArea.strLedgerName, "0001"), 2) * -1;
                                string i = Utility.mInsertLedgerOthers(strComID, ooLedger.strLedgerName, imonth, dblcls);
                                dteLedgerFdate = dteLedgerFdate.AddMonths(1);
                            }
                            progressBar2.Value += 1;
                        }
                    }
                    else if (intSelection == 2)
                    {
                        progressBar2.Value = 0;
                        List <AccountsLedger> objArea = accms.mFillLedgerSelectionProjection(strComID, 202, "K", strString, Utility.gstrUserName, intReportOption).ToList();
                        progressBar2.Maximum = objArea.Count;
                        foreach (AccountsLedger ooArea in objArea)
                        {
                            dteLedgerFdate = dteFromDate.Value;
                            for (int imonth = 1; imonth <= 12; imonth++)
                            {
                                strLedgerTDate = Utility.LastDayOfMonth(dteLedgerFdate).ToString("dd-MM-yyyy");
                                dblcls         = Math.Round(Utility.dblLedgerOpBalanceNew(strComID, dteLedgerFdate.ToString("dd-MM-yyyy"), strLedgerTDate, ooArea.strLedgerName, "0001"), 2) * -1;
                                string i = Utility.mInsertLedgerOthers(strComID, ooLedger.strLedgerName, imonth, dblcls);
                                dteLedgerFdate = dteLedgerFdate.AddMonths(1);
                            }
                            progressBar2.Value += 1;
                        }
                    }
                    else if (intSelection == 3)
                    {
                        progressBar2.Value = 0;
                        dblcls             = 0;

                        List <AccountsLedger> objArea = accms.mFillLedgerSelectionProjection(strComID, 202, "K", strString, Utility.gstrUserName, intReportOption).ToList();
                        progressBar2.Maximum = objArea.Count;
                        foreach (AccountsLedger ooArea in objArea)
                        {
                            dteLedgerFdate = dteFromDate.Value;
                            for (int imonth = 1; imonth <= 12; imonth++)
                            {
                                strLedgerTDate = Utility.LastDayOfMonth(dteLedgerFdate).ToString("dd-MM-yyyy");
                                dblcls         = Math.Round(Utility.dblLedgerOpBalanceNew(strComID, dteLedgerFdate.ToString("dd-MM-yyyy"), strLedgerTDate, ooArea.strLedgerName, "0001"), 2) * -1;
                                string i = Utility.mInsertLedgerOthers(strComID, ooLedger.strLedgerName, imonth, dblcls);
                                dteLedgerFdate = dteLedgerFdate.AddMonths(1);
                                dblcls         = 0;
                            }
                            progressBar2.Value += 1;
                        }
                    }

                    strmsg = objExtra.mInsertMpoPerformance(strComID, ooLedger.strLedgerName, dteFromDate.Text, dteToDate.Text, intMode, intSelection, intBaseTarget, cboCompanyID.Text, intReportOption);
                    int percent = (int)(((double)(progressBar1.Value - progressBar1.Minimum) / (double)(progressBar1.Maximum - progressBar1.Minimum)) * 100);
                    progressBar1.Refresh();
                    using (Graphics gr = progressBar1.CreateGraphics())
                    {
                        gr.DrawString(percent.ToString() + "%", SystemFonts.DefaultFont, Brushes.Red, new PointF(progressBar1.Width / 2 - (gr.MeasureString(percent.ToString() + "%",
                                                                                                                                                            SystemFonts.DefaultFont).Width / 2.0F), progressBar1.Height / 2 - (gr.MeasureString(percent.ToString() + "%", SystemFonts.DefaultFont).Height / 2.0F)));
                    }
                    progressBar1.Value += 1;
                    intMode            += 1;
                }
            }

            frmReportViewer frmviewer = new frmReportViewer();

            frmviewer.selector = ViewerSelector.Performance;
            frmviewer.strFdate = dteFromDate.Text;
            frmviewer.strTdate = dteToDate.Text;
            frmviewer.intmode  = intSelection;
            frmviewer.Show();
        }
示例#22
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strString = "", strSlow_fast_Zero = "", strSelection = "";

            //if (Utility.gblnAccessControl)
            //{
            //    if (lstRight.Items.Count == 0)
            //    {
            //        MessageBox.Show("Insuficient Privileges");
            //        return;
            //    }
            //}

            if (radSlowMoving.Checked)
            {
                strSlow_fast_Zero = "S";
            }
            else if (radFastMoving.Checked)
            {
                strSlow_fast_Zero = "F";
            }
            else
            {
                strSlow_fast_Zero = "Z";
            }
            if (radGroupwise.Checked == true)
            {
                strSelection = "G";
            }
            else if (radItemWise.Checked == true)
            {
                strSelection = "I";
            }
            else
            {
                strSelection = "C";
            }

            if (radAllItem.Checked == true)
            {
                for (int i = 0; i < lstLeft.Items.Count; i++)
                {
                    strString = strString + "'" + lstLeft.Items[i].ToString().Replace("'", "''") + "',";
                }
                if (lstLeft.Items.Count == 0)
                {
                    strString = "'None',";
                }
                if (strString != "")
                {
                    strString = Utility.Mid(strString, 0, strString.Length - 1);
                }
            }
            else
            {
                for (int i = 0; i < lstRight.Items.Count; i++)
                {
                    strString = strString + "'" + lstRight.Items[i].ToString().Replace("'", "''") + "',";
                }
                if (strString != "")
                {
                    strString = Utility.Mid(strString, 0, strString.Length - 1);
                }
            }


            frmReportViewer frmviewer = new frmReportViewer();

            frmviewer.selector    = ViewerSelector.SlowFastMoving;
            frmviewer.strFdate    = dteFromDate.Text;
            frmviewer.strTdate    = dteToDate.Text;
            frmviewer.dtetdate    = dteToDate.Value;
            frmviewer.str_S_F_Z   = strSlow_fast_Zero;
            frmviewer.strString   = strString;
            frmviewer.strSelction = strSelection;
            frmviewer.Show();
        }
示例#23
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            ///intmode  STOCKITEM = 4, COMP_REF_NO=3 , SalesReport=5
            int    IntreportS  = 0;
            string strString   = "";
            string strString2  = "";
            int    intSuppress = 0;
            int    intModee    = 0;

            string strBranchId = "";

            if (uctxtBranch.Text == "")
            {
                MessageBox.Show("Please Select Branch Name.");
                return;
            }
            else
            {
                strBranchId = Utility.gstrGetBranchID(strComID, uctxtBranch.Text);
            }



            for (int i = 0; i < lstRight.Items.Count; i++)
            {
                strString2 = strString2 + "'" + lstRight.Items[i].ToString().Replace("'", "''") + "',";
            }
            if (strString2 != "")
            {
                strString2 = Utility.Mid(strString2, 0, strString2.Length - 1);
            }

            if (radGroup.Checked == true)
            {
                intModee = 1;
            }
            else
            {
                intModee = 2;
            }

            if (strFromshow == "Amount")
            {
                if ((radIndividual.Checked == true) && (rbtMPO.Checked == true))
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector     = ViewerSelector.ProductSalesAmount;
                    frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strString4   = uctxtBranch.Text;
                    frmviewer.strBranchId  = strBranchId;
                    frmviewer.strString    = txtCustomerGorupname.Text;
                    frmviewer.strSelction  = uctxtLedgerConfig.Text;
                    frmviewer.strString3   = uctxtMedicalRep.Text;
                    frmviewer.strString2   = strString2;
                    frmviewer.intMode      = intModee;
                    frmviewer.reportTitle2 = "A";
                    frmviewer.Show();
                    return;
                }

                if ((radIndividual.Checked == true) && (radGroup.Checked == true))
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector     = ViewerSelector.ProductSalesAmount;
                    frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strString4   = uctxtBranch.Text;
                    frmviewer.strBranchId  = strBranchId;
                    frmviewer.strString    = txtCustomerGorupname.Text;
                    frmviewer.strSelction  = uctxtLedgerConfig.Text;
                    frmviewer.strString3   = uctxtMedicalRep.Text;
                    frmviewer.strString2   = strString2;
                    frmviewer.intMode      = intModee;
                    frmviewer.reportTitle2 = "A";
                    frmviewer.Show();
                    return;
                }

                if (radAll.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector     = ViewerSelector.ProductSalesAmount;
                    frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strString4   = uctxtBranch.Text;
                    frmviewer.strBranchId  = strBranchId;
                    frmviewer.strString    = txtCustomerGorupname.Text;
                    frmviewer.strSelction  = uctxtLedgerConfig.Text;
                    frmviewer.strString3   = uctxtMedicalRep.Text;
                    frmviewer.strString2   = strString2;
                    frmviewer.intMode      = intModee;
                    frmviewer.reportTitle2 = "A";
                    frmviewer.Show();
                    return;
                }
            }

            if (strFromshow == "Product")
            {
                if (radGroup.Checked == true)
                {
                    intModee = 1;
                }
                else
                {
                    intModee = 2;
                }
                if ((radIndividual.Checked == true) && (rbtMPO.Checked == true))
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector     = ViewerSelector.ProductSalesAmountProduct;
                    frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strString4   = uctxtBranch.Text;
                    frmviewer.strBranchId  = strBranchId;
                    frmviewer.strString    = txtCustomerGorupname.Text;
                    frmviewer.strString3   = uctxtMedicalRep.Text;
                    frmviewer.strString2   = strString2;
                    frmviewer.intMode      = intModee;
                    frmviewer.reportTitle2 = "A";
                    frmviewer.Show();
                    return;
                }

                if ((radIndividual.Checked == true) && (radGroup.Checked == true))
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector     = ViewerSelector.ProductSalesAmountProduct;
                    frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strString4   = uctxtBranch.Text;
                    frmviewer.strBranchId  = strBranchId;
                    frmviewer.strString    = txtCustomerGorupname.Text;
                    frmviewer.strString3   = uctxtMedicalRep.Text;
                    frmviewer.strString2   = strString2;
                    frmviewer.intMode      = intModee;
                    frmviewer.reportTitle2 = "A";
                    frmviewer.Show();
                    return;
                }

                if (radAll.Checked == true)
                {
                    frmReportViewer frmviewer = new frmReportViewer();
                    frmviewer.selector     = ViewerSelector.ProductSalesAmountProduct;
                    frmviewer.strFdate     = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strTdate     = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewer.strString4   = uctxtBranch.Text;
                    frmviewer.strBranchId  = strBranchId;
                    frmviewer.strString    = txtCustomerGorupname.Text;
                    frmviewer.strString3   = uctxtMedicalRep.Text;
                    frmviewer.strString2   = strString2;
                    frmviewer.intMode      = intModee;
                    frmviewer.reportTitle2 = "A";
                    frmviewer.Show();
                    return;
                }
            }
            if (strFromshow == "FinalStatement")
            {
                if (radGroup.Checked == true)
                {
                    intModee = 1;
                }
                else
                {
                    intModee = 2;
                }
                if ((radIndividual.Checked == true) && (rbtMPO.Checked == true))
                {
                    JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer frmviewerAccms = new JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer();
                    frmviewerAccms.selector    = JA.Modulecontrolar.UI.DReport.Accms.ViewerSelector.FinalStatementCustomer;
                    frmviewerAccms.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewerAccms.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewerAccms.strBranchID = "";
                    frmviewerAccms.strSelction = "";
                    frmviewerAccms.strString   = "";
                    if (radGroup.Checked == true)
                    {
                        frmviewerAccms.strSelction = uctxtMedicalRep.Text;
                    }
                    if (rbtMPO.Checked == true)
                    {
                        frmviewerAccms.strString = uctxtMedicalRep.Text;
                    }
                    frmviewerAccms.strString2     = txtCustomerGorupname.Text;
                    frmviewerAccms.strString3     = strString2;
                    frmviewerAccms.mstrBranchName = uctxtBranch.Text;
                    frmviewerAccms.intVtype       = intModee;
                    frmviewerAccms.Show();
                    return;
                }

                if ((radIndividual.Checked == true) && (radGroup.Checked == true))
                {
                    JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer frmviewerAccms = new JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer();
                    frmviewerAccms.selector    = JA.Modulecontrolar.UI.DReport.Accms.ViewerSelector.FinalStatementCustomer;
                    frmviewerAccms.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewerAccms.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewerAccms.strBranchID = "";
                    frmviewerAccms.strSelction = "";
                    frmviewerAccms.strString   = "";
                    if (radGroup.Checked == true)
                    {
                        frmviewerAccms.strSelction = uctxtMedicalRep.Text;
                    }
                    if (rbtMPO.Checked == true)
                    {
                        frmviewerAccms.strString = uctxtMedicalRep.Text;
                    }
                    frmviewerAccms.strString2     = txtCustomerGorupname.Text;
                    frmviewerAccms.strString3     = strString2;
                    frmviewerAccms.mstrBranchName = uctxtBranch.Text;
                    frmviewerAccms.intVtype       = intModee;
                    frmviewerAccms.Show();
                    return;
                }

                if (radAll.Checked == true)
                {
                    JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer frmviewerAccms = new JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer();
                    frmviewerAccms.selector    = JA.Modulecontrolar.UI.DReport.Accms.ViewerSelector.FinalStatementCustomer;
                    frmviewerAccms.strFdate    = dteFromDate.Value.ToString("dd-MM-yyyy");
                    frmviewerAccms.strTdate    = dteToDate.Value.ToString("dd-MM-yyyy");
                    frmviewerAccms.strBranchID = "";
                    frmviewerAccms.strSelction = "";
                    frmviewerAccms.strString   = "";
                    if (radGroup.Checked == true)
                    {
                        frmviewerAccms.strSelction = uctxtMedicalRep.Text;
                    }
                    if (rbtMPO.Checked == true)
                    {
                        frmviewerAccms.strString = uctxtMedicalRep.Text;
                    }
                    frmviewerAccms.strString2     = txtCustomerGorupname.Text;
                    frmviewerAccms.strString3     = strString2;
                    frmviewerAccms.mstrBranchName = uctxtBranch.Text;
                    frmviewerAccms.intVtype       = intModee;
                    frmviewerAccms.Show();
                    return;
                }
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int intSelection, intsummDet = 0, intSuppress;

            if (radGroup.Checked == true)
            {
                intSelection = 0;
            }
            else
            {
                intSelection = 1;
            }
            if (chkSuppress.Checked == true)
            {
                intSuppress = 1;
            }
            else
            {
                intSuppress = 0;
            }
            // 1 opn +tran +cls 2 opn +tra 3 +opn+cls tran +cls 4 5 opn 6 tra 7 cls
            if (chkOpening.Checked == true && chktransaction.Checked == true && chkClosing.Checked == true)
            {
                intsummDet = 1;
            }
            else if (chkOpening.Checked == true && chktransaction.Checked == true && chkClosing.Checked == false)
            {
                intsummDet = 2;
            }
            else if (chkOpening.Checked == true && chktransaction.Checked == false && chkClosing.Checked == true)
            {
                intsummDet = 3;
            }
            else if (chkOpening.Checked == false && chktransaction.Checked == true && chkClosing.Checked == true)
            {
                intsummDet = 4;
            }
            else if (chkOpening.Checked == true && chktransaction.Checked == false && chkClosing.Checked == false)
            {
                intsummDet = 5;
            }
            else if (chkOpening.Checked == false && chktransaction.Checked == true && chkClosing.Checked == false)
            {
                intsummDet = 6;
            }
            else if (chkOpening.Checked == false && chktransaction.Checked == false && chkClosing.Checked == true)
            {
                intsummDet = 7;
            }


            frmReportViewer frmviewer = new frmReportViewer();

            frmviewer.selector       = ViewerSelector.TrailBalance;
            frmviewer.dteFdate       = dteFromDate.Value;
            frmviewer.dteTdate       = dteToDate.Value;
            frmviewer.strSelction    = "Trail Balance";
            frmviewer.intNarration   = intSelection;
            frmviewer.intSummDetails = intsummDet;
            frmviewer.intSP          = intSuppress;
            frmviewer.Show();
        }
示例#25
0
        private void commandButton1_Click(object sender, EventArgs e)
        {
            if (cboJnsLaporan.SelectedIndex == 0) // laporan transaksi
            {
                Guid   _PerusahaanRowID = (Guid)Guid.Empty;
                Guid   _BankRowID       = (Guid)Guid.Empty;
                Guid   _RekeningRowID   = (Guid)Guid.Empty;
                string _CabangID        = "";
                string _Judul           = "Laporan ";
                string _Bank            = "";

                if (cboPT.Text != "")
                {
                    DataRowView drvPT = (DataRowView)cboPT.Items[cboPT.SelectedIndex];
                    _PerusahaanRowID = (Guid)drvPT.Row["RowID"];
                }
                if (cboCabang.Text != "")
                {
                    DataRowView drvCabang = (DataRowView)cboCabang.Items[cboCabang.SelectedIndex];
                    _CabangID = drvCabang.Row["CabangID"].ToString();
                }
                if (cboBank.Text != "")
                {
                    DataRowView drvBank = (DataRowView)cboBank.Items[cboBank.SelectedIndex];
                    _BankRowID = (Guid)cboBank.SelectedValue;
                    _Bank      = "Bank : " + drvBank.Row["Namabank"].ToString();
                }

                if (cboRekening.Text != "")
                {
                    DataRowView drvRekening = (DataRowView)cboRekening.Items[cboRekening.SelectedIndex];
                    _RekeningRowID = (Guid)cboRekening.SelectedValue;
                    _Bank         += " (" + drvRekening.Row["NoRekening"].ToString() + ")";
                }

                int _Pil = 0;
                if (rbTerimaGiro.Checked)
                {
                    _Judul += "Penerimaan Giro"; _Pil = 0;
                }
                if (rbTitipGiro.Checked)
                {
                    _Judul += "Setoran Giro ke Bank"; _Pil = 1;
                }
                if (rbCairGiro.Checked)
                {
                    _Judul += "Pencairan Giro"; _Pil = 3;
                }
                if (rbTolakGiro.Checked)
                {
                    _Judul += "Tolakan Giro"; _Pil = 5;
                }
                if (rbBatalTitip.Checked)
                {
                    _Judul += "Pembatalan Setoran Giro"; _Pil = 2;
                }
                if (rbBatalCair.Checked)
                {
                    _Judul += "Pembatalan Pencairan Giro"; _Pil = 4;
                }
                if (rbBatalTolak.Checked)
                {
                    _Judul += "Pembatalan Tolakan Giro"; _Pil = 6;
                }
                if (rdbAll.Checked)
                {
                    _Judul += "Semua Giro"; _Pil = 7;
                }
                DataTable dt = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_TransaksiGiro_LIST_FILTER_Tanggal"));
                    db.Commands[0].Parameters.Add(new Parameter("@FromDate", SqlDbType.Date, rangeDatePeriode.FromDate));
                    db.Commands[0].Parameters.Add(new Parameter("@ToDate", SqlDbType.Date, rangeDatePeriode.ToDate));
                    if (!rdbAll.Checked)
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@Status", SqlDbType.TinyInt, _Pil));
                    }

                    if (_PerusahaanRowID != Guid.Empty)
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@PerusahaanRowID", SqlDbType.UniqueIdentifier, _PerusahaanRowID));
                    }
                    if (_CabangID != "")
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, _CabangID));
                    }
                    if (_BankRowID != Guid.Empty)
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@BankRowID", SqlDbType.UniqueIdentifier, _BankRowID));
                    }
                    if (_RekeningRowID != Guid.Empty)
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@RekeningRowID", SqlDbType.UniqueIdentifier, _RekeningRowID));
                    }
                    dt = db.Commands[0].ExecuteDataTable();

                    List <ReportParameter> rptParams = new List <ReportParameter>();
                    rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID));
                    rptParams.Add(new ReportParameter("InitPerusahaan", cboPT.Text));
                    rptParams.Add(new ReportParameter("CabangID", _CabangID));
                    rptParams.Add(new ReportParameter("FromDate", rangeDatePeriode.FromDate.ToString()));
                    rptParams.Add(new ReportParameter("ToDate", rangeDatePeriode.ToDate.ToString()));
                    rptParams.Add(new ReportParameter("Judul", _Judul));
                    rptParams.Add(new ReportParameter("Bank", _Bank));
                    frmReportViewer ifrmReport = new frmReportViewer("Laporan.Finance.rptTransaksiGiro.rdlc", rptParams, dt, "dsGiro_GiroMasukan");
                    ifrmReport.Show();
                }
            }
            else // Saldo Giro
            {
                Guid   _PerusahaanRowID = (Guid)Guid.Empty;
                string _CabangID        = "";
                string _Judul           = "Saldo Giro ";

                if (cboPT.Text != "")
                {
                    DataRowView drvPT = (DataRowView)cboPT.Items[cboPT.SelectedIndex];
                    _PerusahaanRowID = (Guid)drvPT.Row["RowID"];
                }
                if (cboCabang.Text != "")
                {
                    DataRowView drvCabang = (DataRowView)cboCabang.Items[cboCabang.SelectedIndex];
                    _CabangID = drvCabang.Row["CabangID"].ToString();
                }

                int _Pil = 0;
                if (rbSaldoGiro.Checked)
                {
                    _Judul += "Ditangan"; _Pil = 0;
                }
                if (rbSaldoTitip.Checked)
                {
                    _Judul += "Titipan"; _Pil = 1;
                }
                if (rbSaldoTolak.Checked)
                {
                    _Judul += "Tolak"; _Pil = 5;
                }

                DataTable dt = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_SaldoGiro_LIST_FILTER_Tanggal"));
                    db.Commands[0].Parameters.Add(new Parameter("@ToDate", SqlDbType.Date, txtTanggal.DateValue));
                    db.Commands[0].Parameters.Add(new Parameter("@Status", SqlDbType.TinyInt, _Pil));
                    if (_PerusahaanRowID != Guid.Empty)
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@PerusahaanRowID", SqlDbType.UniqueIdentifier, _PerusahaanRowID));
                    }
                    if (_CabangID != "")
                    {
                        db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, _CabangID));
                    }
                    dt = db.Commands[0].ExecuteDataTable();

                    List <ReportParameter> rptParams = new List <ReportParameter>();
                    rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID));
                    rptParams.Add(new ReportParameter("InitPerusahaan", cboPT.Text));
                    rptParams.Add(new ReportParameter("CabangID", _CabangID));
                    rptParams.Add(new ReportParameter("ToDate", txtTanggal.DateValue.ToString()));
                    rptParams.Add(new ReportParameter("Judul", _Judul));
                    frmReportViewer ifrmReport = new frmReportViewer("Laporan.Finance.rptSaldoGiro.rdlc", rptParams, dt, "dsGiro_GiroMasukan");
                    ifrmReport.Show();
                }
            }
        }
示例#26
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string strBranchID = "";

            if (uctxtBranchName.Text != "")
            {
                strBranchID = Utility.gstrGetBranchID(strComID, uctxtBranchName.Text);
            }

            if (strReportName == "Ledger")
            {
                if (uctxtCostCenterName.Text == "")
                {
                    MessageBox.Show("Cost Center Name Cannot be Empty");
                    uctxtCostCenterName.Focus();
                    return;
                }
            }
            if (strReportName == "Category")
            {
                if (radIndividual.Checked == true)
                {
                    if (uctxtCostCenterName.Text == "")
                    {
                        MessageBox.Show("Cost Catagory Name Cannot be Empty");
                        uctxtCostCenterName.Focus();
                        return;
                    }
                }
            }
            if (strReportName == "Cost Center")
            {
                if (radIndividual.Checked == true)
                {
                    if (uctxtCostCenterName.Text == "")
                    {
                        MessageBox.Show("Cost Catagory Name Cannot be Empty");
                        uctxtCostCenterName.Focus();
                        return;
                    }
                }
            }
            if (strReportName == "Ledger")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector       = ViewerSelector.CostCenterLedger;
                frmviewer.strFdate       = dteFromDate.Text;
                frmviewer.strTdate       = dteToDate.Text;;
                frmviewer.strString      = uctxtCostCenterName.Text;
                frmviewer.strBranchID    = strBranchID;
                frmviewer.strHeading     = uctxtReportHeading.Text;
                frmviewer.mstrBranchName = uctxtBranchName.Text;
                frmviewer.Show();
            }
            else if (strReportName == "Category")
            {
                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector       = ViewerSelector.CostCategory;
                frmviewer.strFdate       = dteFromDate.Text;
                frmviewer.strTdate       = dteToDate.Text;;
                frmviewer.strString      = uctxtCostCenterName.Text;
                frmviewer.strBranchID    = strBranchID;
                frmviewer.strSelction    = "Category";
                frmviewer.strHeading     = uctxtReportHeading.Text;
                frmviewer.mstrBranchName = uctxtBranchName.Text;
                frmviewer.Show();
            }

            else if (strReportName == "Cost Center")
            {
                int intSummDetails = 0;
                if (radSummary.Checked == true)
                {
                    intSummDetails = 1;
                }
                else
                {
                    intSummDetails = 0;
                }

                frmReportViewer frmviewer = new frmReportViewer();
                frmviewer.selector       = ViewerSelector.CostCenter;
                frmviewer.strFdate       = dteFromDate.Text;
                frmviewer.strTdate       = dteToDate.Text;;
                frmviewer.strString      = uctxtCostCenterName.Text;
                frmviewer.strBranchID    = strBranchID;
                frmviewer.strSelction    = "Category";
                frmviewer.strHeading     = uctxtReportHeading.Text;
                frmviewer.mstrBranchName = uctxtBranchName.Text;
                frmviewer.intSummDetails = intSummDetails;
                frmviewer.Show();
            }
        }
示例#27
0
        private void DisplayReport1()
        {
            DataSet   ds = new dsNotaPembelian();
            DataTable dt = ds.Tables[0];

            string idtr    = "";
            string NoRq    = "";
            string TglRq   = string.Empty;
            string NoDO    = "";
            string TglDO   = string.Empty;
            string NoNota  = "";
            string TglNota = string.Empty;

            string NamaStok = "";
            int    HrgJual  = 0;
            int    QtySJ    = 0;
            int    _No      = 0;

            foreach (DataRow dr in tblHeader.Rows)
            {
                idtr  = Tools.isNull(dr["idtr"], "").ToString().Trim();
                NoRq  = Tools.isNull(dr["no_rq"], "").ToString().Trim();
                TglRq = Tools.isNull(dr["tgl_rq"], "").ToString();
                NoDO  = Tools.isNull(dr["No_do"], "").ToString().Trim();
                TglDO = Tools.isNull(dr["Tgl_do"], "").ToString();
                DateTime result;
                if (DateTime.TryParse(dr["Tgl_nota"].ToString(), out result))
                {
                    TglNota = result.ToString("dd/MM/yyyy");
                }
                else
                {
                    TglNota = "1900/1/1";
                }

                NoNota = Tools.isNull(dr["No_nota"], "").ToString().Trim();
                _No    = _No + 1;
                DataRow[] Details = tblDetail.Select("Idtr='" + idtr + "'");

                foreach (DataRow drd in Details)
                {
                    NamaStok = Tools.isNull(drd["Nama_stok"], "").ToString().Trim();
                    HrgJual  = Convert.ToInt32(Tools.isNull(drd["H_jual"], "0").ToString().Trim());
                    QtySJ    = Convert.ToInt32(Tools.isNull(drd["J_sj"], "0").ToString().Trim());

                    DataRow drw = dt.NewRow();
                    drw["NoRequest"]     = NoRq;
                    drw["TglRequest"]    = TglRq;
                    drw["NoNota"]        = NoNota;
                    drw["TglNota"]       = TglNota;
                    drw["NamaBarang"]    = NamaStok;
                    drw["QtySuratJalan"] = QtySJ;
                    drw["HrgBeli"]       = HrgJual;
                    drw["TglDO"]         = TglDO;
                    drw["NoDO"]          = NoDO;
                    drw["Nilai"]         = _No;
                    dt.Rows.Add(drw);
                }
            }


            if (dt.Rows.Count > 0)
            {
                string periode;
                periode = String.Format("Tanggal :{0}", ((DateTime)DateTime.Now).ToString("dd/MM/yyyy"));
                //construct parameter
                List <ReportParameter> rptParams = new List <ReportParameter>();
                rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID));
                rptParams.Add(new ReportParameter("Periode", periode));
                rptParams.Add(new ReportParameter("Gudang", GlobalVar.Gudang));

                //call report viewer
                frmReportViewer ifrmReport = new frmReportViewer("Communicator.rptNotaPembelianDownload.rdlc", rptParams, dt, "dsNotaPembelian_Data");
                ifrmReport.Show();
            }
        }
示例#28
0
        private void DisplayReport(DataSet ds)
        {
            try
            {
                string periode = string.Empty;
                periode     = String.Format("PERIODE : {0} s/d {1}", rangeDateBox1.FromDate.Value.ToString("dd-MM-yyyy"), rangeDateBox1.ToDate.Value.ToString("dd-MM-yyyy"));
                this.Cursor = Cursors.WaitCursor;
                List <ReportParameter> rptParams = new List <ReportParameter>();
                rptParams.Add(new ReportParameter("Periode", periode));

                if (comboBox1.SelectedIndex == 0)
                {
                    rptParams.Add(new ReportParameter("Title", "PIUTANG LAIN LAIN"));
                }
                else if (comboBox1.SelectedIndex == 1)
                {
                    rptParams.Add(new ReportParameter("Title", "PIUTANG LAIN LAIN (KARTU HUTANG )"));
                }
                else if (comboBox1.SelectedIndex == 2)
                {
                    rptParams.Add(new ReportParameter("Title", "PIUTANG LAIN LAIN(DKN)"));
                    DataTable dtt = ds.Tables[0].DefaultView.ToTable(true, "RowID", "NominalIDR").Copy();
                    string    val = Convert.ToDouble(dtt.Compute("SUM(NominalIDR)", "")).ToString("N2");
                    rptParams.Add(new ReportParameter("Nominal", val));
                }
                else if (comboBox1.SelectedIndex == 3)
                {
                    rptParams.Add(new ReportParameter("Title", "HUTANG LAIN LAIN(DKN)"));
                    DataTable dtt = ds.Tables[0].DefaultView.ToTable(true, "RowID", "NominalIDR").Copy();
                    string    val = Convert.ToDouble(dtt.Compute("SUM(NominalIDR)", "")).ToString("N2");
                    rptParams.Add(new ReportParameter("Nominal", val));
                }

                string file = string.Empty;
                if (comboBox1.SelectedIndex == 0)
                {
                    file = "Keuangan.rptPiutangLainLain_Detail_A.rdlc";
                }
                else if (comboBox1.SelectedIndex == 1)
                {
                    file = "Keuangan.rptPiutangLainLain_Detail_B.rdlc";
                }
                else
                {
                    file = "Keuangan.rptPiutangLainLain_Detail_C.rdlc";
                }

                List <DataTable> pTable = new List <DataTable>();
                pTable.Add(ds.Tables[0]);

                List <string> pDatasetName = new List <string>();
                pDatasetName.Add("dsPLL_dtLain");

                //call report viewer
                frmReportViewer ifrmReport = new frmReportViewer(file, rptParams, pTable, pDatasetName);
                ifrmReport.Text = "Piutang Lain - Lain";
                ifrmReport.Show();
            }
            catch (System.Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
示例#29
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmbSupplier.SelectedIndex == -1)
                {
                    MessageBox.Show("Please select the Supplier");
                    return;
                }
                //else if (cmbBrand.SelectedIndex == -1)
                //{
                //    MessageBox.Show("Please select the Brand");
                //    return;
                //}
                //else if (cmbMainCategory.SelectedIndex == -1)
                //{
                //    MessageBox.Show("Please select the Main Category");
                //    return;
                //}
                //else if (cmbSubCat.SelectedIndex == -1)
                //{
                //    MessageBox.Show("Please select the Sub Category");
                //    return;
                //}

                if (dgvGRN.Rows.Count == 0)
                {
                    MessageBox.Show("Please Item Add to Grid");
                    return;
                }

                foreach (DataGridViewRow row in dgvGRN.Rows)
                {
                    if (Convert.ToBoolean(row.Cells[dgvGRN.Columns[clmGRNQty.Name].Index].Value == null) || (Convert.ToInt32(row.Cells[dgvGRN.Columns[clmGRNQty.Name].Index].Value) == 0))
                    {
                        MessageBox.Show("Please Enter GRN Qty");
                        return;
                    }
                    if (Convert.ToBoolean(row.Cells[dgvGRN.Columns[clmUnitPrice.Name].Index].Value == null) || (Convert.ToInt32(row.Cells[dgvGRN.Columns[clmUnitPrice.Name].Index].Value) == 0))
                    {
                        MessageBox.Show("Please Enter Unit Price Qty");
                        return;
                    }
                }

                DialogResult drs = MessageBox.Show("Are You Sure All Infromation Correct?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);

                if (drs == DialogResult.Yes)
                {
                    using (TransactionScope ts = new TransactionScope())
                    {
                        intGRNHeaderID = 0;
                        List <GRNEntity> lstGRNSave = new List <GRNEntity>();

                        Execute        objExecute = new Execute();
                        SqlParameter[] param      = new SqlParameter[]
                        {
                            Execute.AddParameter("@intSupplierID", Convert.ToInt32(cmbSupplier.SelectedValue))
                        };

                        intGRNHeaderID = objExecute.ExecuteIdentity("spSaveGRNHeader", param, CommandType.StoredProcedure);

                        foreach (DataGridViewRow dr in dgvGRN.Rows)
                        {
                            GRNEntity objGRNEntity = new GRNEntity
                            {
                                intGRNHeaderID     = intGRNHeaderID,
                                intItemID          = Convert.ToInt32(dr.Cells[clmItemID1.Name].Value.ToString()),
                                decGRNQty          = Convert.ToDecimal(dr.Cells[clmGRNQty.Name].Value.ToString()),
                                decUnitPrice       = Convert.ToDecimal(dr.Cells[clmUnitPrice.Name].Value.ToString()),
                                decDiscountedValue = Convert.ToDecimal(dr.Cells[clmDiscountedValue.Name].Value.ToString()),
                            };
                            lstGRNSave.Add(objGRNEntity);
                        }

                        foreach (GRNEntity item in lstGRNSave)
                        {
                            Execute        objExecuteX = new Execute();
                            SqlParameter[] paramX      = new SqlParameter[]
                            {
                                Execute.AddParameter("@intGRNHeaderID", item.intGRNHeaderID),
                                Execute.AddParameter("@intItemID", item.intItemID),
                                Execute.AddParameter("@decGRNQty", item.decGRNQty),
                                Execute.AddParameter("@decUnitPrice", item.decUnitPrice),
                                Execute.AddParameter("@decDiscountedValue", item.decDiscountedValue),
                            };

                            objExecuteX.Executes("spSaveGRNDetails", paramX, CommandType.StoredProcedure);
                        }

                        ts.Complete();
                    }

                    MessageBox.Show("Save..");

                    System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

                    ///Report///////////////////////////////////////////////////
                    ///
                    rptGRN         rpt    = new rptGRN();
                    ReportDocument rptDoc = new ReportDocument();

                    rptDoc = rpt;

                    Execute        objExecuteXX = new Execute();
                    string         Query        = "[dbo].[spGetGRNReportDetails]";
                    SqlParameter[] para         = new SqlParameter[]
                    {
                        Execute.AddParameter("@intGRNHeaderID", intGRNHeaderID)
                    };
                    DataTable dt = (DataTable)objExecuteXX.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure);

                    rpt.SetDataSource(dt);

                    System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;

                    frmReportViewer objfrmReportViewer = new frmReportViewer(rptDoc);
                    objfrmReportViewer.Show();

                    //rptDoc.PrintToPrinter(1, true, 0, 0);

                    clear();

                    //////////////////////////////b
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Data Saving Error");
                Logger.LoggError(ex, "btnSave_Click");
            }
        }
示例#30
0
        private void DisplayReport(DataSet ds)
        {
            //construct parameter
            string sales = "Semua";

            if (lookupSales.NamaSales.Trim() != "")
            {
                sales = lookupSales.SalesID;
            }
            string toko = "Semua";

            if (lookupToko.NamaToko.Trim() != "")
            {
                toko = lookupToko.NamaToko;
            }
            string bruttoNetto = "Netto";

            if (rdoBrutto.Checked)
            {
                bruttoNetto = "Brutto";
            }
            string groupBrg = "Semua";

            if (cboGroupBrg.Text != "")
            {
                groupBrg = cboGroupBrg.Text;
            }

            double dQtyTransaksi = 0.0, dNilaiTransaksi = 0.0, dQtyBonus = 0.0, dNilaiBonus = 0.0;

            for (int i = 0; i < ds.Tables.Count; i++)
            {
                if (ds.Tables[i].Rows.Count > 0)
                {
                    string
                        qtyT   = ds.Tables[i].Compute("SUM(QtyTransaksi)", "").ToString(),
                        nilaiT = ds.Tables[i].Compute("SUM(NilaiTransaksi)", "").ToString(),
                        qtyB   = ds.Tables[i].Compute("SUM(QtyBonus)", "").ToString(),
                        nilaiB = ds.Tables[i].Compute("SUM(NilaiBonus)", "").ToString();
                    dQtyTransaksi   = dQtyTransaksi + double.Parse(qtyT);
                    dNilaiTransaksi = dNilaiTransaksi + double.Parse(nilaiT);
                    dQtyBonus       = dQtyBonus + double.Parse(qtyB);
                    dNilaiBonus     = dNilaiBonus + double.Parse(nilaiB);
                }
            }

            string periode;

            periode = String.Format("{0} s/d {1}", ((DateTime)rgbPeriode.FromDate).ToString("dd/MM/yyyy"), ((DateTime)rgbPeriode.ToDate).ToString("dd/MM/yyyy"));

            List <ReportParameter> rptParams = new List <ReportParameter>();

            rptParams.Add(new ReportParameter("Periode", periode));
            rptParams.Add(new ReportParameter("Sales", sales));
            rptParams.Add(new ReportParameter("Toko", toko));
            rptParams.Add(new ReportParameter("GroupBarang", groupBrg));
            rptParams.Add(new ReportParameter("BruttoNetto", bruttoNetto));
            rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID));
            rptParams.Add(new ReportParameter("sumQtyTransaksi", dQtyTransaksi.ToString()));
            rptParams.Add(new ReportParameter("sumNilaiTransaksi", dNilaiTransaksi.ToString()));
            rptParams.Add(new ReportParameter("sumQtyBonus", dQtyBonus.ToString()));
            rptParams.Add(new ReportParameter("sumNilaiBonus", dNilaiBonus.ToString()));

            List <DataTable> rptDt = new List <DataTable>();

            rptDt.Add(ds.Tables[0]);

            List <string> rptDs = new List <string>();

            rptDs.Add("dsNotaPenjualan_Data");

            if (ds.Tables.Count == 3)
            {
                rptDt.Add(ds.Tables[1]);
                rptDt.Add(ds.Tables[2]);
                rptDs.Add("dsNotaPenjualan_Data2");
                rptDs.Add("dsNotaPenjualan_Data3");
            }
            else
            {
                DataTable dt = new DataTable();
                rptDt.Add(dt);
                rptDt.Add(dt);
                rptDs.Add("dsNotaPenjualan_Data2");
                rptDs.Add("dsNotaPenjualan_Data3");
            }

            //call report viewer
            frmReportViewer ifrmReport = new frmReportViewer("Bonus.rptPerincianPerhitunganBonus.rdlc", rptParams, rptDt, rptDs);

            ifrmReport.Show();
        }