Esempio n. 1
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 DG_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 4)
            {
                //string strReposne = Utility.mCheckCommission(strComID, DG.CurrentRow.Cells[2].Value.ToString(), DG.CurrentRow.Cells[1].Value.ToString());
                //if (strReposne != "")
                //{
                //    MessageBox.Show("Commission is Already Configured, Cannot Alter");
                //    return;
                //}
                if (Utility.gblnAccessControl)
                {
                    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
                    {
                        MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                if (onAddAllButtonClicked != null)
                {
                    onAddAllButtonClicked(GetSelectedItem(), sender, e);
                }
                this.Dispose();
            }
            if (e.ColumnIndex == 5)
            {
                string strReposne = Utility.mCheckCommission(strComID, DG.CurrentRow.Cells[2].Value.ToString(), DG.CurrentRow.Cells[1].Value.ToString());
                if (strReposne != "")
                {
                    MessageBox.Show("Transaction Found Cannot Delete");
                    return;
                }

                if (Utility.gblnAccessControl)
                {
                    if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
                    {
                        MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                var strResponse = MessageBox.Show("Do You  want to Delete?", "Delete Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (strResponse == DialogResult.Yes)
                {
                    string i = accms.DeleteManualMpoCmm(strComID, DG.CurrentRow.Cells[0].Value.ToString());
                    MessageBox.Show(i.ToString());
                    if (i == "Delete Successfully...")
                    {
                        DG.Rows.RemoveAt(e.RowIndex);
                    }
                }
            }
            if (e.ColumnIndex == 6)
            {
                JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer();
                frmviewer.selector   = JA.Modulecontrolar.UI.DReport.Accms.ViewerSelector.MpoCommManuallist;
                frmviewer.strString  = DG.CurrentRow.Cells[0].Value.ToString();
                frmviewer.strString2 = DG.CurrentRow.Cells[1].Value.ToString();
                //frmviewer.strHeading = "Payment Voucher";
                frmviewer.Show();
            }
        }
Esempio n. 3
0
 private void DG_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 3)
     {
         if (Utility.gblnAccessControl)
         {
             if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
             {
                 MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return;
             }
         }
         if (onAddAllButtonClicked != null)
         {
             onAddAllButtonClicked(GetSelectedItem(), sender, e);
         }
         this.Dispose();
     }
     if (e.ColumnIndex == 4)
     {
         if (Utility.gblnAccessControl)
         {
             if (!Utility.glngGetPriviliges(strComID, Utility.gstrUserName, lngFormPriv, 2))
             {
                 MessageBox.Show("You have no Permission to Access", "Privileges", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return;
             }
         }
         var strResponse = MessageBox.Show("Do You  want to Delete?", "Delete Button", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (strResponse == DialogResult.Yes)
         {
             string i = accms.DeleteLedgerConfig(strComID, DG.CurrentRow.Cells[0].Value.ToString());
             MessageBox.Show(i.ToString());
             mLoadGroupList();
         }
     }
     if (e.ColumnIndex == 5)
     {
         if (System.Windows.Forms.Application.OpenForms["frmLedgerConfigurationPercentage"] as frmLedgerConfigurationPercentage == null)
         {
             frmLedgerConfigurationPercentage objfrm = new frmLedgerConfigurationPercentage();
             objfrm.strLedgerName = DG.CurrentRow.Cells[1].Value.ToString();
             objfrm.Show();
             objfrm.MdiParent = this.MdiParent;
         }
         else
         {
             frmLedgerConfigurationPercentage objfrm = (frmLedgerConfigurationPercentage)Application.OpenForms["frmLedgerConfigurationPercentage"];
             objfrm.Focus();
             objfrm.MdiParent = this.MdiParent;
         }
     }
     if (e.ColumnIndex == 6)
     {
         JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer frmviewer = new JA.Modulecontrolar.UI.DReport.Accms.Viewer.frmReportViewer();
         frmviewer.selector   = JA.Modulecontrolar.UI.DReport.Accms.ViewerSelector.LedgerConfig;
         frmviewer.strString  = DG.CurrentRow.Cells[1].Value.ToString();
         frmviewer.strHeading = "Ledger Configuration List";
         frmviewer.Show();
     }
 }