示例#1
0
        private void cbMonth_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbMonth.SelectedItem != null && cbYear.SelectedItem != null && lkAccount.EditValue != null && listBoxControl1.SelectedItem.ToString().Equals("Issued Amount by Month"))
            {
                IssuedAmoutPerMonth issueAmountReport = new IssuedAmoutPerMonth(CurrentContext.LoggedInUserName);

                issueAmountReport.DataSource   = IssueDoc.IssueAmountByPaymentType(Convert.ToInt32(cbMonth.SelectedIndex + 1), Convert.ToInt32(cbYear.SelectedItem), Convert.ToInt32(lkAccount.EditValue), Convert.ToBoolean(checbySellingPrice.Checked));
                issueAmountReport.xrMonth.Text = string.Format("{0} {1}", cbMonth.SelectedItem, cbYear.SelectedItem);
                printControl1.PrintingSystem   = issueAmountReport.PrintingSystem;
                report = issueAmountReport;
                issueAmountReport.CreateDocument();
            }
            else if (cbMonth.SelectedItem != null && cbYear.SelectedItem != null && lkAccount.EditValue != null && listBoxControl1.SelectedItem.ToString().Equals("Received Amount by Month"))
            {
                ReceivedAmoutPerMonth receivedAmountReport = new ReceivedAmoutPerMonth(CurrentContext.LoggedInUserName);

                receivedAmountReport.DataSource   = ReceiveDoc.ReceivedAmountByReason(Convert.ToInt32(cbMonth.SelectedIndex + 1), Convert.ToInt32(cbYear.SelectedItem), Convert.ToInt32(lkAccount.EditValue));
                receivedAmountReport.xrMonth.Text = string.Format("{0} {1}", cbMonth.SelectedItem, cbYear.SelectedItem);
                printControl1.PrintingSystem      = receivedAmountReport.PrintingSystem;
                report = receivedAmountReport;
                receivedAmountReport.CreateDocument();
            }
            else if (cbMonth.SelectedItem != null && lkMode.EditValue != null && cbYear.SelectedItem != null && listBoxControl1.SelectedItem.ToString().Equals("Cost of Good Sold"))
            {
                CostOfGoodSold costOfGoodSold = new CostOfGoodSold(CurrentContext.LoggedInUserName);

                costOfGoodSold.DataSource = IssueDoc.CostOfSales(Convert.ToInt32(cbMonth.SelectedIndex + 1),
                                                                 Convert.ToInt32(cbYear.SelectedItem),
                                                                 Convert.ToInt32(lkMode.EditValue));

                costOfGoodSold.xrMonth.Text  = string.Format("{0} {1}", cbMonth.SelectedItem, cbYear.SelectedItem);
                printControl1.PrintingSystem = costOfGoodSold.PrintingSystem;
                report = costOfGoodSold;
                costOfGoodSold.CreateDocument();
            }
            else if (lkMode.EditValue != null && lkCategories.EditValue != null && cbMonth.SelectedItem != null && cbYear.SelectedItem != null && cbToYear.SelectedItem != null && cbToMonth.SelectedItem != null && listBoxControl1.SelectedItem.ToString().Equals("Vital Report"))
            {
                LadVitalItemReport();
            }
        }