private void LoadData() { try { this.Cursor = Cursors.WaitCursor; BindingCollection <modCustReceivableSummary> list = _dal.GetCustReceivableSummary(cboAccName.ComboBox.SelectedValue.ToString(), 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[0].Visible = false; DBGrid.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.Columns[8].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; DBGrid.AlternatingRowsDefaultCellStyle.BackColor = Color.Empty; DBGrid.Rows[DBGrid.RowCount - 1].DefaultCellStyle.BackColor = frmOptions.ALTERNATING_BACKCOLOR; } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
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; } }
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; } }