Esempio n. 1
0
 private void LoadData()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         BindingCollection <modAccCheckList> list = _dal.GetIList(cboStatus.SelectedValue.ToString(), string.Empty, cboSubject.SelectedValue.ToString(), cboCheckType.SelectedValue.ToString(), cboBank.SelectedValue.ToString(), txtCheckNo.Text.Trim(), out Util.emsg);
         DBGrid.DataSource = list;
         if (list == null && !string.IsNullOrEmpty(Util.emsg))
         {
             MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             return;
         }
         else
         {
             DBGrid.Columns["mny"].DefaultCellStyle.Alignment          = DataGridViewContentAlignment.MiddleRight;
             DBGrid.Columns["exchangerate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
             decimal totalmny = 0;
             foreach (modAccCheckList mod in list)
             {
                 totalmny += mod.Mny;
             }
             Status1.Text = "合计金额: " + string.Format("{0:N}", totalmny);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Esempio n. 2
0
        private void DBGrid2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            frmViewList           frm;
            modAccAssetDebtReport mod = (modAccAssetDebtReport)DBGrid2.CurrentRow.DataBoundItem;

            switch (mod.SubjectId)
            {
            case "5145":       //应付帐款
                dalAccPayableList dalpay = new dalAccPayableList();
                BindingCollection <modVendorPayableSummary> listpay = dalpay.GetVendorPayableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg);
                if (listpay != null && listpay.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listpay);
                    frm.ShowDialog();
                }
                break;

            case "5125":       //应付票据
                dalAccCheckList dalcheck = new dalAccCheckList();
                BindingCollection <modAccCheckList> listcheck = dalcheck.GetIList("0", string.Empty, mod.SubjectId, string.Empty, string.Empty, string.Empty, out Util.emsg);
                frm = new frmViewList();
                frm.InitViewList(mod.SubjectName, listcheck);
                frm.ShowDialog();
                break;

            case "5155":       //其它应付款
                dalAccOtherPayable dalopay = new dalAccOtherPayable();
                BindingCollection <modOtherPayableSummary> listopay = dalopay.GetOtherPayableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg);
                if (listopay != null && listopay.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listopay);
                    frm.ShowDialog();
                }
                break;

            default:
                dalAccReport dalrpt = new dalAccReport();
                BindingCollection <modAccCredenceDetail> listrpt = new BindingCollection <modAccCredenceDetail>();
                dalrpt.GetCredenceDetail(true, cboAccName.ComboBox.SelectedValue.ToString(), mod.SubjectId, Util.IsTrialBalance, ref listrpt, out Util.emsg);
                if (listrpt != null && listrpt.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listrpt);
                    frm.ShowDialog();
                }
                else
                {
                    if (!string.IsNullOrEmpty(Util.emsg))
                    {
                        MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                break;
            }
        }
Esempio n. 3
0
        private void DBGrid1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            frmViewList           frm;
            modAccAssetDebtReport mod = (modAccAssetDebtReport)DBGrid1.CurrentRow.DataBoundItem;

            switch (mod.SubjectId)
            {
            case "1055":       //应收帐款
                dalAccReceivableList dalrec = new dalAccReceivableList();
                BindingCollection <modCustReceivableSummary> listrec = dalrec.GetCustReceivableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg);
                if (listrec != null && listrec.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listrec);
                    frm.ShowDialog();
                }
                break;

            case "1060":       //其它应收款
                dalAccOtherReceivable dalorec = new dalAccOtherReceivable();
                BindingCollection <modOtherReceivableSummary> listorec = dalorec.GetOtherReceivableSummary(cboAccName.ComboBox.SelectedValue.ToString(), out Util.emsg);
                if (listorec != null && listorec.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listorec);
                    frm.ShowDialog();
                }
                break;

            case "1075":       //应收票据
                dalAccCheckList dalcheck = new dalAccCheckList();
                BindingCollection <modAccCheckList> listcheck = dalcheck.GetIList("0", string.Empty, mod.SubjectId, string.Empty, string.Empty, string.Empty, out Util.emsg);
                frm = new frmViewList();
                frm.InitViewList(mod.SubjectName, listcheck);
                frm.ShowDialog();
                break;

            case "1235":       //库存商品
                dalAccProductInout dalio = new dalAccProductInout();
                BindingCollection <modAccProductSummary> listio = dalio.GetAccProductSummary(cboAccName.ComboBox.SelectedValue.ToString(), Util.IsTrialBalance, out Util.emsg);
                if (listio != null && listio.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listio);
                    frm.ShowDialog();
                }
                break;

            default:
                dalAccReport dalrpt = new dalAccReport();
                BindingCollection <modAccCredenceDetail> listrpt = new BindingCollection <modAccCredenceDetail>();
                dalrpt.GetCredenceDetail(true, cboAccName.ComboBox.SelectedValue.ToString(), mod.SubjectId, Util.IsTrialBalance, ref listrpt, out Util.emsg);
                if (listrpt != null && listrpt.Count > 0)
                {
                    frm = new frmViewList();
                    frm.InitViewList(mod.SubjectName, listrpt);
                    frm.ShowDialog();
                }
                else
                {
                    if (!string.IsNullOrEmpty(Util.emsg))
                    {
                        MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                break;
            }
        }
Esempio n. 4
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (DBGrid.CurrentRow == null)
                {
                    return;
                }

                frmViewList       frm = new frmViewList();
                modAccountBalance mod = (modAccountBalance)DBGrid.CurrentRow.DataBoundItem;
                switch (mod.SubjectId)
                {
                case "1030":       //现金银行
                    BindingCollection <modAccCredenceDetail> listcash = _dal.GetCashAndBankDetail(Util.modperiod.AccName, Util.IsTrialBalance, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listcash);
                    break;

                case "1235":       //库存商品
                    dalAccProductInout dalpdt = new dalAccProductInout();
                    BindingCollection <modAccProductSummary> listpdt = dalpdt.GetAccProductSummary(Util.modperiod.AccName, Util.IsTrialBalance, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listpdt);
                    break;

                case "1055":       //应收帐款
                    dalAccReceivableList dalrec = new dalAccReceivableList();
                    BindingCollection <modCustReceivableSummary> listrec = dalrec.GetCustReceivableSummary(Util.modperiod.AccName, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listrec);
                    break;

                case "5145":       //应付账款
                    dalAccPayableList dalpay = new dalAccPayableList();
                    BindingCollection <modVendorPayableSummary> listpay = dalpay.GetVendorPayableSummary(Util.modperiod.AccName, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listpay);
                    break;

                case "1060":       //其它应收款
                    dalAccOtherReceivable dalorec = new dalAccOtherReceivable();
                    BindingCollection <modOtherReceivableSummary> listorec = dalorec.GetOtherReceivableSummary(Util.modperiod.AccName, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listorec);
                    break;

                case "5155":       //其他应付款
                    dalAccOtherPayable dalopay = new dalAccOtherPayable();
                    BindingCollection <modOtherPayableSummary> listopay = dalopay.GetOtherPayableSummary(Util.modperiod.AccName, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listopay);
                    break;

                case "1075":       //应收票据
                    dalAccCheckList dalcheckrec = new dalAccCheckList();
                    BindingCollection <modAccCheckList> listcheckrec = dalcheckrec.GetIList("0", string.Empty, mod.SubjectId, string.Empty, string.Empty, string.Empty, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listcheckrec);
                    break;

                case "5125":       //应付票据
                    dalAccCheckList dalcheckpay = new dalAccCheckList();
                    BindingCollection <modAccCheckList> listcheckpay = dalcheckpay.GetIList("0", string.Empty, mod.SubjectId, string.Empty, string.Empty, string.Empty, out Util.emsg);
                    frm.InitViewList(mod.SubjectName + clsTranslate.TranslateString("Detail"), listcheckpay);
                    break;

                default:
                    break;
                }
                frm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }