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; } }
protected void LoadData() { try { this.Cursor = Cursors.WaitCursor; 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 <modVQuotationDetail> list = _dal.GetVDetail(custlist, string.Empty, string.Empty, txtProductName.Text.Trim(), dtpFrom.Text, dtpTo.Text, out Util.emsg); DBGrid.DataSource = list; decimal sum = 0; if (list == null || list.Count == 0) { 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); } StatusLabel1.Text = "共 0 行数据, 合计金额为: " + string.Format("{0:C2}", sum); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { this.Cursor = Cursors.Default; } }