protected override void ShowSearchForm() { Query.ConditionXChooseForm f = new Query.ConditionXChooseForm(); if (f.ShowDialog(this) == DialogResult.OK) { Query.ConditionX condition = f.Condition as Query.ConditionX; this.bindingSource1.DataSource = ((BL.InvoiceXOManager)this.invoiceManager).SelectByYJRQCustomEmpCusXOId(condition.Customer1, condition.Customer2, condition.StartDate, condition.EndDate, condition.Yjri1, condition.Yjri2, condition.Employee1, condition.Employee2, condition.XOId1, condition.XOId2, condition.CusXOId, condition.Product, condition.Product2, condition.IsClose, false, false); } f.Dispose(); GC.Collect(); this.barStaticItem1.Caption = string.Format("{0}По", this.bindingSource1.Count); }
protected override void ShowSearchForm() { if (this.tag == 1) { this.tag = 0; return; } Query.ConditionXChooseForm f = new Query.ConditionXChooseForm(); if (f.ShowDialog(this) == DialogResult.OK) { Query.ConditionX con = f.Condition as Query.ConditionX; this.bindingSource1.DataSource = ((BL.InvoiceXSManager) this.invoiceManager).SelectDateRangAndWhere(con.Customer1, con.Customer2, con.StartDate, con.EndDate, con.Yjri1, con.Yjri2, con.CusXOId, con.Product, con.XOId1, con.XOId2, con.DepotId, con.HandBookId); } f.Dispose(); GC.Collect(); }
//更改查询条件 private void btnChangeSearch_Click(object sender, EventArgs e) { this.RecordSelected(); Query.ConditionXChooseForm f = new Query.ConditionXChooseForm(); if (f.ShowDialog(this) == DialogResult.OK) { Query.ConditionX con = f.Condition as Query.ConditionX; this.bsHeader.DataSource = this._mInvoiceXSManager.SelectDateRangAndWhere(con.Customer1, con.Customer2, con.StartDate, con.EndDate, con.Yjri1, con.Yjri2, con.CusXOId, con.Product, con.Product2, con.XOId1, con.XOId2, con.FreightedCompanyId, con.ConveyanceMethodId, con.Employee1, con.Employee2, con.Product_Id, con.ProductCategoryId); if (this.bsHeader.Current != null) { Model.InvoiceXS xs = this.bsHeader.Current as Model.InvoiceXS; IList <Model.InvoiceXSDetail> xsd = this._mInvoiceXSDetailManager.Select(xs); (this.bsHeader.Current as Model.InvoiceXS).Details = xsd; this.bindingSource1.DataSource = (this.bsHeader.Current as Model.InvoiceXS).Details; } } f.Dispose(); GC.Collect(); }
protected override void ShowSearchForm() { if (this.tag == 1) { this.tag = 0; return; } Query.ConditionXChooseForm f = new Query.ConditionXChooseForm(); if (f.ShowDialog(this) == DialogResult.OK) { Query.ConditionX con = f.Condition as Query.ConditionX; this.bindingSource1.DataSource = ((BL.InvoiceXSManager) this.invoiceManager).SelectDateRangAndWhere(con.Customer1, con.StartDate, con.EndDate, con.CusXOId, con.Product, null, con.FreightedCompanyId, con.ConveyanceMethodId); } else { this.Dispose(); this.Close(); } this.barStaticItem1.Caption = string.Format("{0}Items", this.bindingSource1.Count); f.Dispose(); GC.Collect(); }
protected override void ShowSearchForm() { if (this.tag == 1) { this.tag = 0; return; } Query.ConditionXChooseForm f = new Query.ConditionXChooseForm(); if (f.ShowDialog(this) == DialogResult.OK) { Query.ConditionX con = f.Condition as Query.ConditionX; DataTable dtDetail = new DataTable(); //this.bindingSource1.DataSource = ((BL.InvoiceXSManager)this.invoiceManager).SelectDateRangAndWhere(con.Customer1, con.Customer2, con.StartDate, con.EndDate, con.Yjri1, con.Yjri2, con.CusXOId, con.Product, con.Product2, con.XOId1, con.XOId2, con.FreightedCompanyId, con.ConveyanceMethodId, con.Employee1, con.Employee2); dtDetail = ((BL.InvoiceXSManager) this.invoiceManager).SelectDateRangAndWhereToTable(con.Customer1, con.Customer2, con.StartDate, con.EndDate, con.Yjri1, con.Yjri2, con.CusXOId, con.Product, con.Product2, con.XOId1, con.XOId2, con.FreightedCompanyId, con.ConveyanceMethodId, con.Employee1, con.Employee2, con.Product_Id, con.ProductCategoryId); if (dtDetail != null || dtDetail.Rows.Count > 0) { dtHeader = dtDetail.Clone(); dtHeader.Columns.Add("XSId"); for (int i = 0; i < dtDetail.Rows.Count; i++) { if (i == 0) { DataRow dr = dtHeader.NewRow(); dr.ItemArray = dtDetail.Rows[i].ItemArray; dr["CustomerInvoiceXOId"] = ""; dtHeader.Rows.Add(dr); } else { if (dtDetail.Rows[i]["InvoiceId"].ToString() == dtDetail.Rows[i - 1]["InvoiceId"].ToString()) { dtHeader.Rows[dtHeader.Rows.Count - 1]["XOMoney"] = Convert.ToDecimal(dtHeader.Rows[dtHeader.Rows.Count - 1]["XOMoney"]) + Convert.ToDecimal(dtDetail.Rows[i]["XOMoney"]); dtHeader.Rows[dtHeader.Rows.Count - 1]["XSMoney"] = Convert.ToDecimal(dtHeader.Rows[dtHeader.Rows.Count - 1]["XSMoney"]) + Convert.ToDecimal(dtDetail.Rows[i]["XSMoney"]); } else { DataRow dr = dtHeader.NewRow(); dr.ItemArray = dtDetail.Rows[i].ItemArray; dr["CustomerInvoiceXOId"] = ""; dtHeader.Rows.Add(dr); } } dtDetail.Rows[i]["Employee0"] = ""; dtDetail.Rows[i]["Customer"] = ""; dtDetail.Rows[i]["Depot"] = ""; dtDetail.Rows[i]["InvoiceDate"] = DBNull.Value; dtDetail.Rows[i]["InvoiceNote"] = ""; } DataSet ds = new DataSet(); ds.Tables.Add(dtHeader); ds.Tables.Add(dtDetail); ds.Relations.Add(dtHeader.Columns["InvoiceId"], dtDetail.Columns["InvoiceId"]); this.gridView1.OptionsDetail.ShowDetailTabs = false; this.gridControl1.DataSource = this.bindingSource1.DataSource = dtHeader; this.gridControl1.RefreshDataSource(); } } else { this.Dispose(); this.Close(); } this.barStaticItem1.Caption = string.Format("{0}По", this.bindingSource1.Count); f.Dispose(); GC.Collect(); }