FrmFundInOutQuery2.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Core.Mes.Client.Comm.Server;
  10. using Core.Mes.Client.Comm.Control;
  11. using System.Collections;
  12. namespace Core.StlMes.Client.Sale.SaleFundMgt.FundUI.UIFrm
  13. {
  14. public partial class FrmFundInOutQuery2 : FrmFundBase
  15. {
  16. public FrmFundInOutQuery2()
  17. {
  18. InitializeComponent();
  19. }
  20. private DataSet dsMain = new DataSet();
  21. private DataSet dsDetail = new DataSet();
  22. private string _buyercode = "";
  23. FundBLL.ValueList.PubValueList PubValueList = null;
  24. private Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Fund.FundBll fundBll = null;
  25. private void FrmFundInOutQuery2_Load(object sender, EventArgs e)
  26. {
  27. this.checkBox1.Checked = true;//复选框默认选中
  28. this.dateTimePicker2.Value = System.DateTime.Now.AddDays(-System.DateTime.Now.Day + 1);
  29. fundBll = new Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Fund.FundBll(this.ob);
  30. PubValueList = new Core.StlMes.Client.Sale.SaleFundMgt.FundBLL.ValueList.PubValueList(this.ob);
  31. dsDetail = base.GetDataSetByColumnName(GetTbColumn_SEL_FUND_CUST_FUNDINOUT(),
  32. new System.Collections.Hashtable(), base.GetFundColumnNameAndCaption());
  33. Init();
  34. this.ultraGrid1.DisplayLayout.Bands[1].Columns["BUSISEQ"].Width = 110;
  35. }
  36. private void SetForeColor()
  37. {
  38. try
  39. {
  40. foreach (Infragistics.Win.UltraWinGrid.UltraGridRow ugrs in this.ultraGrid1.Rows)
  41. {
  42. if (ugrs.Cells["ISVALID"].Value.ToString() == "0")
  43. ugrs.Appearance.ForeColor = Color.Red;
  44. }
  45. }
  46. catch
  47. { }
  48. }
  49. public override void ToolBar_Click(object sender, string ToolbarKey)
  50. {
  51. switch (ToolbarKey)
  52. {
  53. case "Query":
  54. Query();
  55. break;
  56. case "Export":
  57. Core.StlMes.Client.Sale.Util.UtilUltraGrid.ExportGridDataToExcel("回款记录", this.ultraGrid1);
  58. break;
  59. case "Close":
  60. Close();
  61. break;
  62. }
  63. }
  64. public void Query()
  65. {
  66. string buyercode = this._buyercode;
  67. string begintime = this.dateTimePicker2.Value.ToString(base._dateTimeFormatYyyyMmdd);
  68. string endtime = this.dateTimePicker3.Value.ToString(base._dateTimeFormatYyyyMmdd);
  69. if (!this.checkBox1.Checked)
  70. {
  71. begintime = System.DateTime.Now.AddYears(-100).ToString(base._dateTimeFormatYyyyMmdd);
  72. endtime = System.DateTime.Now.AddYears(2).ToString(base._dateTimeFormatYyyyMmdd);
  73. }
  74. dataSet1.Clear();
  75. DataTable dt1 = ServerHelper.GetData("core.stlmes.server.sale.dao.fund.FundInOutDao2.queryinoutorderbyorderno", new Object[] { begintime, endtime, buyercode }, this.ob);
  76. DataTable dt2 = ServerHelper.GetData("core.stlmes.server.sale.dao.fund.FundInOutDao2.queryinoutdetail", new Object[] { begintime, endtime, buyercode }, this.ob);
  77. GridHelper.CopyDataToDatatable(ref dt1, ref this.dataTable1, true);
  78. GridHelper.CopyDataToDatatable(ref dt2, ref this.dataTable2, true);
  79. SetForeColor();
  80. }
  81. private void button1_Click_1(object sender, EventArgs e)
  82. {
  83. UIDlgBox.DlgCustChoose custChoose = new Core.StlMes.Client.Sale.SaleFundMgt.FundUI.UIDlgBox.DlgCustChoose(this.ob);
  84. custChoose.CustUse = "100202";
  85. custChoose.SaleOrg = base.GetSaleOrg();
  86. custChoose.ShowDialog();
  87. if (custChoose.DialogResult == DialogResult.OK)
  88. {
  89. this.textBox1.Text = custChoose.customerName;
  90. _buyercode = custChoose.customerNo;
  91. this.Query();
  92. }
  93. }
  94. //// //将字段的数字与字符串一一对应
  95. private Infragistics.Win.ValueList GetIsValid()
  96. {
  97. Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
  98. lit.ValueListItems.Add("0", "无效");
  99. lit.ValueListItems.Add("1", "有效");
  100. return lit;
  101. }
  102. //////将字段的数字与字符串一一对应
  103. private Infragistics.Win.ValueList GetMoneyDel()
  104. {
  105. Infragistics.Win.ValueList lit = new Infragistics.Win.ValueList();
  106. lit.ValueListItems.Add("0", "无");
  107. lit.ValueListItems.Add("1", "制造");
  108. lit.ValueListItems.Add("2", "集团");
  109. return lit;
  110. }
  111. //将字段中的数字进行用字符串替代
  112. private void Init()
  113. {
  114. try
  115. {
  116. this.ultraGrid1.DisplayLayout.Bands[0].Columns["BUYERCODE"].ValueList
  117. = PubValueList.GetCustomerInfo();
  118. this.ultraGrid1.DisplayLayout.Bands[1].Columns["PREBUYERCODE"].ValueList
  119. = PubValueList.GetCustomerInfo();
  120. this.ultraGrid1.DisplayLayout.Bands[1].Columns["ISVALID"].ValueList
  121. = GetIsValid();
  122. this.ultraGrid1.DisplayLayout.Bands[1].Columns["MONEY_DELIVER"].ValueList
  123. = GetMoneyDel();
  124. }
  125. catch
  126. { }
  127. //this.ultraGrid1.DisplayLayout.Bands[0].Columns["BUYERCODE"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
  128. //this.ultraGrid1.DisplayLayout.Bands[0].Columns["SECONDACCOUNT"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
  129. //this.ultraGrid1.DisplayLayout.Bands[0].Columns["BALANCESUBJECT"].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;
  130. }
  131. }
  132. }