| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using System.Collections;
- namespace Core.StlMes.Client.Sale.SaleFundMgt.FundUI.UIFrm
- {
- public partial class FrmFundInOutQuery2 : FrmFundBase
- {
- public FrmFundInOutQuery2()
- {
- InitializeComponent();
- }
- private DataSet dsMain = new DataSet();
- private DataSet dsDetail = new DataSet();
- private string _buyercode = "";
- FundBLL.ValueList.PubValueList PubValueList = null;
- private Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Fund.FundBll fundBll = null;
- private void FrmFundInOutQuery2_Load(object sender, EventArgs e)
- {
- this.checkBox1.Checked = true;//复选框默认选中
- this.dateTimePicker2.Value = System.DateTime.Now.AddDays(-System.DateTime.Now.Day + 1);
- fundBll = new Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Fund.FundBll(this.ob);
- PubValueList = new Core.StlMes.Client.Sale.SaleFundMgt.FundBLL.ValueList.PubValueList(this.ob);
- dsDetail = base.GetDataSetByColumnName(GetTbColumn_SEL_FUND_CUST_FUNDINOUT(),
- new System.Collections.Hashtable(), base.GetFundColumnNameAndCaption());
- Init();
- this.ultraGrid1.DisplayLayout.Bands[1].Columns["BUSISEQ"].Width = 110;
- }
- private void SetForeColor()
- {
- try
- {
- foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrs in this.ultraGrid1.Rows)
- {
- if (ugrs.Cells["ISVALID"].Value.ToString() == "0")
- ugrs.Appearance.ForeColor = Color.Red;
- }
- }
- catch
- { }
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- Query();
- break;
- case "Export":
- Core.StlMes.Client.Sale.Util.UtilUltraGrid.ExportGridDataToExcel("回款记录", this.ultraGrid1);
- break;
- case "Close":
- Close();
- break;
- }
- }
- public void Query()
- {
- string buyercode = this._buyercode;
- string begintime = this.dateTimePicker2.Value.ToString(base._dateTimeFormatYyyyMmdd);
- string endtime = this.dateTimePicker3.Value.ToString(base._dateTimeFormatYyyyMmdd);
- if (!this.checkBox1.Checked)
- {
- begintime = System.DateTime.Now.AddYears(-100).ToString(base._dateTimeFormatYyyyMmdd);
- endtime = System.DateTime.Now.AddYears(2).ToString(base._dateTimeFormatYyyyMmdd);
- }
- dataSet1.Clear();
- DataTable dt1 = ServerHelper.GetData("core.stlmes.server.sale.dao.fund.FundInOutDao2.queryinoutorderbyorderno", new Object[] { begintime, endtime, buyercode }, this.ob);
- DataTable dt2 = ServerHelper.GetData("core.stlmes.server.sale.dao.fund.FundInOutDao2.queryinoutdetail", new Object[] { begintime, endtime, buyercode }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt1, ref this.dataTable1, true);
- GridHelper.CopyDataToDatatable(ref dt2, ref this.dataTable2, true);
- SetForeColor();
- }
- private void button1_Click_1(object sender, EventArgs e)
- {
- UIDlgBox.DlgCustChoose custChoose = new Core.StlMes.Client.Sale.SaleFundMgt.FundUI.UIDlgBox.DlgCustChoose(this.ob);
- custChoose.CustUse = "100202";
- custChoose.SaleOrg = base.GetSaleOrg();
- custChoose.ShowDialog();
- if (custChoose.DialogResult == DialogResult.OK)
- {
- this.textBox1.Text = custChoose.customerName;
- _buyercode = custChoose.customerNo;
- this.Query();
- }
- }
- //// //将字段的数字与字符串一一对应
- private Infragistics.Win.ValueList GetIsValid()
- {
- Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
- lit.ValueListItems.Add("0", "无效");
- lit.ValueListItems.Add("1", "有效");
- return lit;
- }
- //////将字段的数字与字符串一一对应
- private Infragistics.Win.ValueList GetMoneyDel()
- {
- Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
- lit.ValueListItems.Add("0", "无");
- lit.ValueListItems.Add("1", "制造");
- lit.ValueListItems.Add("2", "集团");
- return lit;
- }
- //将字段中的数字进行用字符串替代
- private void Init()
- {
- try
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["BUYERCODE"].ValueList
- = PubValueList.GetCustomerInfo();
- this.ultraGrid1.DisplayLayout.Bands[1].Columns["PREBUYERCODE"].ValueList
- = PubValueList.GetCustomerInfo();
- this.ultraGrid1.DisplayLayout.Bands[1].Columns["ISVALID"].ValueList
- = GetIsValid();
- this.ultraGrid1.DisplayLayout.Bands[1].Columns["MONEY_DELIVER"].ValueList
- = GetMoneyDel();
- }
- catch
- { }
- //this.ultraGrid1.DisplayLayout.Bands[0].Columns["BUYERCODE"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
- //this.ultraGrid1.DisplayLayout.Bands[0].Columns["SECONDACCOUNT"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
- //this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALANCESUBJECT"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
- }
- }
- }
|