private void mnuDetail_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentRow == null) { return; } BindingCollection <modAccProductInout> list = _dal.GetIList(cboAccName.ComboBox.SelectedValue.ToString(), DBGrid.CurrentRow.Cells["productid"].Value.ToString(), Util.IsTrialBalance, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(list[0].ProductName, list); frm.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void btnProduct_Click(object sender, EventArgs e) { dalWarehouseProductInout dal = new dalWarehouseProductInout(); BindingCollection <modProductSizeWip> list = dal.GetProductSizeWip(Util.modperiod.AccName, out Util.emsg); frmViewList frm = new frmViewList(); frm.InitViewList("请选择产品及尺寸:", list); frm.Selection = true; if (frm.ShowDialog() == DialogResult.OK) { dalProductList dalpdt = new dalProductList(); modProductList modpdt = dalpdt.GetItem(Util.retValue1, out Util.emsg); txtProductId.Text = Util.retValue1; txtProductName.Text = Util.retValue2; txtSize.Text = Util.retValue3; if (modpdt.SizeFlag == 1) { txtSize.Enabled = true; } else { txtSize.Enabled = false; } txtQty.Focus(); } }
private void mnuPurchaseList_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentRow == null) { return; } modCustomerOrderList mod = (modCustomerOrderList)DBGrid.CurrentRow.DataBoundItem; dalPurchaseList dal = new dalPurchaseList(); BindingCollection <modVPurchaseDetail> list = dal.GetVDetail(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, mod.ProductId, string.Empty, mod.CustOrderNo, string.Empty, string.Empty, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Purchase List"), list); frm.ShowDialog(); } else { MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void mnuAssetEvaluate_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentRow == null) { return; } modAssetList mod = (modAssetList)DBGrid.CurrentRow.DataBoundItem; dalAssetEvaluate dal = new dalAssetEvaluate(); BindingCollection <modAssetEvaluate> list = dal.GetIList(string.Empty, string.Empty, mod.AssetId, string.Empty, string.Empty, string.Empty, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Asset Evaluate"), list); frm.ShowDialog(); } else { MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void toolImport_Click(object sender, EventArgs e) { try { frmViewList frmsel = new frmViewList(); dalCustomerOrderList dalorder = new dalCustomerOrderList(); BindingCollection <modCustomerOrderList> listorder = dalorder.GetIList(false, string.Empty, string.Empty, string.Empty, string.Empty, DateTime.Today.AddDays(-30).ToString("MM-dd-yyyy"), string.Empty, out Util.emsg); if (listorder != null) { frmsel.Selection = true; frmsel.InitViewList("请选择要导入的客户订单号:", listorder); if (frmsel.ShowDialog() == DialogResult.OK) { EditDesignForm frm = new EditDesignForm(); frm.Import(Convert.ToInt32(Util.retValue1)); if (frm.ShowDialog() == DialogResult.OK) { LoadData(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void toolImport_Click(object sender, EventArgs e) { try { frmViewList frmsel = new frmViewList(); dalQuotationForm dalquot = new dalQuotationForm(); BindingCollection <modVQuotationDetail> listquot = dalquot.GetVDetail(string.Empty, string.Empty, string.Empty, string.Empty, DateTime.Today.AddDays(-30).ToString("MM-dd-yyyy"), string.Empty, out Util.emsg); if (listquot != null) { frmsel.InitViewList("请选择要导入的客户报价单号:", listquot); frmsel.Selection = true; if (frmsel.ShowDialog() == DialogResult.OK) { modVQuotationDetail mod = dalquot.GetDetailItem(Util.retValue1, Convert.ToInt32(Util.retValue2), out Util.emsg); if (mod != null) { EditCustomerOrderList frm = new EditCustomerOrderList(); frm.ImportItem(mod); if (frm.ShowDialog() == DialogResult.OK) { LoadData(); } } } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void mnuHistoryDetail_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentRow == null) { return; } if (DBGrid.CurrentRow.Cells[0].Value == null || string.IsNullOrEmpty(DBGrid.CurrentRow.Cells[0].Value.ToString())) { return; } BindingCollection <modVQuotationDetail> list = _dal.GetVDetail(string.Empty, string.Empty, DBGrid.CurrentRow.Cells[0].Value.ToString(), string.Empty, DateTime.Today.AddDays(-365).ToString("MM-dd-yyyy"), string.Empty, out Util.emsg); if (list != null) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("History Detail"), list); frm.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void DBGrid_DoubleClick(object sender, EventArgs e) { if (DBGrid.CurrentRow == null) { return; } string statuslist = "9"; if (chkNotAudit.Checked) { statuslist += ",0"; } if (chkAudited.Checked) { statuslist += ",1"; } BindingCollection <modProductionForm> list = new BindingCollection <modProductionForm>(); if (DBGrid.CurrentRow.Index == DBGrid.RowCount - 1) { list = _dal.GetIList(statuslist, string.Empty, string.Empty, string.Empty, txtInvNo.Text.Trim(), txtDeptId.Text.Trim(), dtpFrom.Text, dtpTo.Text, out Util.emsg); } else { modProductionSummary moditem = (modProductionSummary)DBGrid.CurrentRow.DataBoundItem; list = _dal.GetIList(statuslist, string.Empty, string.Empty, string.Empty, txtInvNo.Text.Trim(), moditem.DeptId, dtpFrom.Text, dtpTo.Text, out Util.emsg); } if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Production Form"), list); frm.ShowDialog(); } }
private void DBGrid_DoubleClick(object sender, EventArgs e) { if (DBGrid.CurrentRow == null) { return; } string statuslist = "9"; if (chkNotAudit.Checked) { statuslist += ",0"; } if (chkAudited.Checked) { statuslist += ",1"; } modAccExpenseSummary mod = (modAccExpenseSummary)DBGrid.CurrentRow.DataBoundItem; BindingCollection <modAccExpenseForm> list = _dal.GetIList(statuslist, string.Empty, mod.ExpenseId, mod.ExpenseMan, dtpFrom.Text, dtpTo.Text, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Account Expense Form"), list); frm.ShowDialog(); } }
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; } }
private void btnAssetId_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; dalAssetList dal = new dalAssetList(); BindingCollection <modAssetList> list = dal.GetIList("1", string.Empty, string.Empty, string.Empty, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList("请选择资产:", list); frm.Selection = true; if (frm.ShowDialog() == DialogResult.OK) { modAssetList mod = dal.GetItem(Util.retValue1, out Util.emsg); if (mod != null) { txtAssetId.Text = mod.AssetId; txtAssetName.Text = mod.AssetName; txtNetMny.Text = mod.NetMny.ToString(); } else { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void ACC_WAITING_AUDIT_LIST_Click(object sender, EventArgs e) { dalAccReport _dal = new dalAccReport(); BindingCollection <modWaitingAuditList> list = _dal.GetWaitingAuditList(Util.modperiod.AccName, Util.modperiod.StartDate.ToString(), Util.modperiod.EndDate.ToString(), out Util.emsg); if (list != null) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Waiting Audit List"), list); frm.ShowDialog(); } else { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void DBGrid_DoubleClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentCell == null) { return; } if (DBGrid.CurrentCell.ColumnIndex == 0) { return; } if (DBGrid.CurrentCell.Value == null) { return; } string actiontype = string.Empty; if (DBGrid.CurrentCell.ColumnIndex < DBGrid.ColumnCount - 1) { actiontype = DBGrid.Columns[DBGrid.CurrentCell.ColumnIndex].Name; } string actionman = string.Empty; if (DBGrid.CurrentCell.RowIndex < DBGrid.RowCount - 1) { actionman = DBGrid.Rows[DBGrid.CurrentCell.RowIndex].Cells[0].Value.ToString(); } BindingCollection <modCustomerLog> list = _dal.GetIList(string.Empty, string.Empty, actiontype, actionman, string.Empty, dtpFrom.Text, dtpTo.Text, out Util.emsg); if (list != null) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Customer Log"), list); frm.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void DBGrid_DoubleClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentRow == null) { return; } dalAccReport dal = new dalAccReport(); modAccExpenseReport mod = (modAccExpenseReport)DBGrid.CurrentRow.DataBoundItem; if (mod.SubjectId.IndexOf("9135") == 0) { BindingCollection <modAccCredenceDetail> list = new BindingCollection <modAccCredenceDetail>(); dal.GetCredenceDetail(true, cboAccName.ComboBox.SelectedValue.ToString(), mod.SubjectId, Util.IsTrialBalance, ref list, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(mod.SubjectName, list); frm.ShowDialog(); } else { if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void mnuCustomerLog_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid.CurrentRow == null) { return; } modCustomerList mod = (modCustomerList)DBGrid.CurrentRow.DataBoundItem; dalCustomerLog dallog = new dalCustomerLog(); BindingCollection <modCustomerLog> listlog = dallog.GetIList(mod.CustId, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, out Util.emsg); if (listlog != null && listlog.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Customer Log"), listlog); frm.ShowDialog(); } else { if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void mnuAccProductInout2_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid2.CurrentRow == null) { return; } dalAccProductInout dal = new dalAccProductInout(); BindingCollection <modAccProductInout> list = dal.GetIList(DBGrid2.CurrentRow.Cells["productid"].Value.ToString(), false, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(list[0].ProductName, list); frm.ShowDialog(); } else { if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(clsTranslate.TranslateString("No data found!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void txtContent_DoubleClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; TextBox txt = (TextBox)sender; if (rbSchedule.Checked) { frmViewText frm = new frmViewText(clsTranslate.TranslateString("Action Schedule"), txt.Text.Trim()); frm.ShowDialog(); } else { string traceflaglist = string.Empty; if (rbCustomerLog.Checked) { traceflaglist = "1"; } dalCustomerLog dal = new dalCustomerLog(); BindingCollection <modCustomerLog> list = dal.GetIList(string.Empty, string.Empty, string.Empty, txtSalesMan.Text, traceflaglist, ((TextBox)sender).Tag.ToString(), DateTime.Parse(txt.Tag.ToString()).AddDays(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss"), out Util.emsg); if (list != null) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Customer Log"), list); frm.ShowDialog(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void ACC_WAITING_AUDIT_LIST_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { dalAccReport dal = new dalAccReport(); BindingCollection <modWaitingAuditList> list = dal.GetWaitingAuditList(Util.modperiod.AccName, Util.modperiod.StartDate.ToString("MM-dd-yyyy"), Util.modperiod.EndDate.ToString("MM-dd-yyyy"), out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList("未处理单据清单", list); frm.ShowDialog(); } else { if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("没有找到未处理的数据", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void btnCheckId_Click(object sender, EventArgs e) { dalAccCheckList dal = new dalAccCheckList(); BindingCollection <modAccCheckList> list = dal.GetWaitingCredenceList(string.Empty, out Util.emsg); if (list != null) { frmViewList frm = new frmViewList(); frm.InitViewList("请选择要承兑的支票:", list); frm.Selection = true; if (frm.ShowDialog() == DialogResult.OK) { modAccCheckList mod = dal.GetItem(Convert.ToInt32(Util.retValue1), out Util.emsg); txtCheckId.Text = mod.Id.ToString(); txtSubjectName.Text = mod.SubjectName; txtCheckNo.Text = mod.CheckNo; txtCheckType.Text = mod.CheckType; txtBankName.Text = mod.BankName; txtCurrency.Text = mod.Currency; txtMny.Text = mod.Mny.ToString(); txtExchangeRate.Text = mod.ExchangeRate.ToString(); } } }
private void DBGrid_DoubleClick(object sender, EventArgs e) { if (DBGrid.CurrentRow == null) { return; } string statuslist = "9"; if (chkNotAudit.Checked) { statuslist += ",0"; } if (chkAudited.Checked) { statuslist += ",1"; } string paystatuslist = string.Empty; if (chkPay0.Checked) { paystatuslist += ",0"; } if (chkPay1.Checked) { paystatuslist += ",1"; } string invoicestatuslist = string.Empty; if (chkInvoice0.Checked) { invoicestatuslist += ",0"; } if (chkInvoice1.Checked) { invoicestatuslist += ",1"; } if (chkInvoice2.Checked) { invoicestatuslist += ",2"; } string vendorlist = string.Empty; if (lstVendor.SelectedItems.Count > 0 && lstVendor.SelectedItems.Count < lstVendor.Items.Count) { for (int i = 0; i < lstVendor.SelectedItems.Count; i++) { modVendorList mod = (modVendorList)lstVendor.SelectedItems[i]; if (i == 0) { vendorlist = mod.VendorName; } else { vendorlist += "," + mod.VendorName; } } } BindingCollection <modVPurchaseDetail> list = new BindingCollection <modVPurchaseDetail>(); if (DBGrid.CurrentRow.Index == DBGrid.RowCount - 1) { list = _dal.GetVDetail(statuslist, cboPurchaseType.SelectedValue.ToString(), vendorlist, string.Empty, string.Empty, paystatuslist, invoicestatuslist, string.Empty, string.Empty, string.Empty, string.Empty, dtpFrom.Text, dtpTo.Text, out Util.emsg); } else { modPurchaseSummary moditem = (modPurchaseSummary)DBGrid.CurrentRow.DataBoundItem; list = _dal.GetVDetail(string.Empty, moditem.PurchaseType, moditem.VendorName, string.Empty, string.Empty, paystatuslist, invoicestatuslist, moditem.Currency, string.Empty, string.Empty, string.Empty, dtpFrom.Text, dtpTo.Text, out Util.emsg); } if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Purchase List"), list); frm.ShowDialog(); } }
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; } }
private void txtProduct_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == Convert.ToChar(Keys.Enter) || e.KeyChar == Convert.ToChar(Keys.Space)) { dalProductSalePrice dalprice = new dalProductSalePrice(); dalProductList dal = new dalProductList(); BindingCollection <modProductList> list = dal.GetIListByBarcode(txtProduct.Text.Trim(), out Util.emsg); if (list != null && list.Count > 0) { if (list.Count == 1) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(DBGrid); row.Height = 40; row.Cells[0].Value = list[0].ProductId; row.Cells[1].Value = list[0].ProductName; row.Cells[2].Value = list[0].Barcode; row.Cells[3].Value = list[0].UnitNo; row.Cells[4].Value = 1; row.Cells[5].Value = dalprice.GetDefaultPrice(list[0].ProductId, out Util.emsg); row.Cells[6].Value = decimal.Parse(row.Cells[5].Value.ToString()); row.Cells[8].Value = list[0].Specify; DBGrid.Rows.Add(row); row.Dispose(); } else { frmViewList frm = new frmViewList(); frm.InitViewList("请选择商品:", list); frm.Selection = true; if (frm.ShowDialog() == DialogResult.OK) { var modPdt = list.Where(c => c.ProductId == Util.retValue1).First(); DataGridViewRow row = new DataGridViewRow(); row.CreateCells(DBGrid); row.Height = 40; row.Cells[0].Value = modPdt.ProductId; row.Cells[1].Value = modPdt.ProductName; row.Cells[2].Value = modPdt.Barcode; row.Cells[3].Value = modPdt.UnitNo; row.Cells[4].Value = 1; row.Cells[5].Value = dalprice.GetDefaultPrice(modPdt.ProductId, out Util.emsg); row.Cells[6].Value = decimal.Parse(row.Cells[5].Value.ToString()); row.Cells[8].Value = modPdt.Specify; DBGrid.Rows.Add(row); row.Dispose(); } } SumData(); } else { modProductList mod = dal.GetItem(txtProduct.Text.Trim(), out Util.emsg); if (mod != null) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(DBGrid); row.Height = 40; row.Cells[0].Value = mod.ProductId; row.Cells[1].Value = mod.ProductName; row.Cells[2].Value = mod.Barcode; row.Cells[3].Value = mod.UnitNo; row.Cells[4].Value = 1; row.Cells[5].Value = dalprice.GetDefaultPrice(mod.ProductId, out Util.emsg); row.Cells[6].Value = decimal.Parse(row.Cells[5].Value.ToString()); row.Cells[8].Value = mod.Specify; DBGrid.Rows.Add(row); row.Dispose(); SumData(); } else { MessageBox.Show("没有找到商品!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } if (DBGrid.RowCount > 0) { DBGrid.CurrentCell = DBGrid.Rows[DBGrid.RowCount - 1].Cells[4]; } txtProduct.Text = string.Empty; txtProduct.Focus(); } }
private void DBGrid_DoubleClick(object sender, EventArgs e) { if (DBGrid.CurrentRow == null) { return; } string statuslist = "9"; if (chkNotAudit.Checked) { statuslist += ",0"; } if (chkAudited.Checked) { statuslist += ",1"; } string paystatuslist = string.Empty; if (chkPay0.Checked) { paystatuslist += ",0"; } if (chkPay1.Checked) { paystatuslist += ",1"; } string invoicestatuslist = string.Empty; if (chkInvoice0.Checked) { invoicestatuslist += ",0"; } if (chkInvoice1.Checked) { invoicestatuslist += ",1"; } if (chkInvoice2.Checked) { invoicestatuslist += ",2"; } string custlist = string.Empty; if (lstCustomer.SelectedItems.Count > 0 && lstCustomer.SelectedItems.Count < lstCustomer.Items.Count) { for (int i = 0; i < lstCustomer.SelectedItems.Count; i++) { modCustomerList mod = (modCustomerList)lstCustomer.SelectedItems[i]; if (i == 0) { custlist = mod.CustId; } else { custlist += "," + mod.CustId; } } } BindingCollection <modSalesDesignForm> list = new BindingCollection <modSalesDesignForm>(); if (DBGrid.CurrentRow.Index == DBGrid.RowCount - 1) { list = _dal.GetIList(statuslist, cboFormType.SelectedValue.ToString(), custlist, string.Empty, string.Empty, string.Empty, string.Empty, paystatuslist, invoicestatuslist, dtpFrom.Text, dtpTo.Text, out Util.emsg); } else { modSalesDesignSummary moditem = (modSalesDesignSummary)DBGrid.CurrentRow.DataBoundItem; list = _dal.GetIList(string.Empty, moditem.FormType, moditem.CustId, string.Empty, string.Empty, string.Empty, string.Empty, paystatuslist, invoicestatuslist, dtpFrom.Text, dtpTo.Text, out Util.emsg); } if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(clsTranslate.TranslateString("Sales Shipment Detail"), list); frm.ShowDialog(); } }
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; } string productid = DBGrid.CurrentRow.Cells["ProductId"].Value.ToString(); string warehouseid = string.Empty; string size = string.Empty; string fromdate = string.Empty; string todate = string.Empty; modAccPeriodList mod = (modAccPeriodList)cboAccName.SelectedItem; fromdate = mod.StartDate.ToString("MM-dd-yyyy"); if (mod.LockFlag == 0) { todate = mod.EndDate >= DateTime.Today ? mod.EndDate.ToString("MM-dd-yyyy") : DateTime.Today.ToString("MM-dd-yyyy"); } else { todate = mod.EndDate.ToString("MM-dd-yyyy"); } if (rbProductSizeWip.Checked) { size = DBGrid.CurrentRow.Cells["size"].Value.ToString(); } else if (rbWarehouseProductWip.Checked) { warehouseid = DBGrid.CurrentRow.Cells["warehouseid"].Value.ToString(); } else if (rbWarehouseProductSizeWip.Checked) { warehouseid = DBGrid.CurrentRow.Cells["warehouseid"].Value.ToString(); size = DBGrid.CurrentRow.Cells["size"].Value.ToString(); } BindingCollection <modWarehouseProductInout> list = _dal.GetIList(warehouseid, productid, string.Empty, size, string.Empty, fromdate, todate, out Util.emsg); if (list != null && list.Count > 0) { frmViewList frm = new frmViewList(); frm.InitViewList(this.Text, list); frm.ShowDialog(); } else { if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void toolTrial_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; Util.emsg = string.Empty; dalAccReport dal = new dalAccReport(); BindingCollection <modWaitingAuditList> list = dal.GetWaitingAuditList(Util.modperiod.AccName, Util.modperiod.StartDate.ToString(), Util.modperiod.EndDate.ToString(), out Util.emsg); if (list != null && list.Count > 0) { frmViewList frmvl = new frmViewList(); frmvl.InitViewList(clsTranslate.TranslateString("Waiting Audit List"), list); frmvl.ShowDialog(); if (MessageBox.Show("您本月还有未完成单据,您是否要试算?", clsTranslate.TranslateString("Confirm"), MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No) { return; } } BindingCollection <modAccountBalance> list2 = dal.GetAccountBalance(Util.modperiod.AccName, false, out Util.emsg); if (list2 != null && list2.Count > 0) { foreach (modAccountBalance mod in list2) { if (mod.SubjectId != "1030" && Math.Abs(mod.Differ) > Convert.ToDecimal("1")) { MessageBox.Show("财务数据不平衡,请先联系程序员检查原因并修正错误!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); frmViewList frmvl = new frmViewList(); frmvl.InitViewList(clsTranslate.TranslateString("Account Balance"), list2); frmvl.ShowDialog(); return; } } } else if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } EditAccCredenceList frm = new EditAccCredenceList(); frm.AddItem("试算平衡", string.Empty); if (frm.ShowDialog() == DialogResult.OK) { Util.IsTrialBalance = true; LoadData(); MessageBox.Show("试算操作成功,您现在查到的财务报表是您试算之后的数据!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); frmMain frmmain = (frmMain)this.ParentForm; ((Label)frmmain.Controls.Find("lblTrialBalance", true).First()).Visible = true; toolNew.Visible = false; toolEdit.Visible = false; toolDel.Visible = false; toolAudit.Visible = false; toolReset.Visible = false; toolTrial.Visible = false; toolBalance.Visible = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void toolBalance_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; Util.emsg = string.Empty; dalAccReport dal = new dalAccReport(); BindingCollection <modWaitingAuditList> list = dal.GetWaitingAuditList(Util.modperiod.AccName, Util.modperiod.StartDate.ToString(), Util.modperiod.EndDate.ToString(), out Util.emsg); if (list != null && list.Count > 0) { MessageBox.Show("您本月还有未完成单据,不能结算!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); frmViewList frmvl = new frmViewList(); frmvl.InitViewList(clsTranslate.TranslateString("Waiting Audit List"), list); frmvl.ShowDialog(); return; } BindingCollection <modAccountBalance> list2 = dal.GetAccountBalance(Util.modperiod.AccName, Util.IsTrialBalance, out Util.emsg); if (list2 != null && list2.Count > 0) { foreach (modAccountBalance mod in list2) { if (Math.Abs(mod.Differ) >= Convert.ToDecimal("0.5")) { MessageBox.Show("财务数据不平衡,请先联系程序员检查原因并修正错误!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); frmViewList frmvl = new frmViewList(); frmvl.InitViewList(clsTranslate.TranslateString("Account Balance"), list2); frmvl.ShowDialog(); return; } } } else if (!string.IsNullOrEmpty(Util.emsg)) { MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } EditAccCredenceList frm = new EditAccCredenceList(); frm.AddItem("月末结算", string.Empty); if (frm.ShowDialog() == DialogResult.OK) { Util.IsTrialBalance = false; LoadData(); EditAccPeriodList frmapl = new EditAccPeriodList(); frmapl.InitForm(Util.modperiod.EndDate.AddDays(1)); frmapl.AddItem(Util.UserId); if (frmapl.ShowDialog() == DialogResult.OK) { Util.modperiod.LockFlag = 1; dalAccAnalyzeProfit dalprofit = new dalAccAnalyzeProfit(); dalprofit.Generate(Util.modperiod.AccName, Util.IsTrialBalance, out Util.emsg); dalAccAnalyzeSales dalsales = new dalAccAnalyzeSales(); dalsales.Generate(Util.modperiod.AccName, out Util.emsg); dalAccAnalyzePurchase dalpur = new dalAccAnalyzePurchase(); dalpur.Generate(Util.modperiod.AccName, out Util.emsg); dalAccAnalyzeWaste dalwaste = new dalAccAnalyzeWaste(); dalwaste.Generate(Util.modperiod.AccName, out Util.emsg); dalAccAnalyzeProduct dalpdt = new dalAccAnalyzeProduct(); dalpdt.Generate(Util.modperiod.AccName, out Util.emsg); Application.Exit(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }