| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- 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.Control;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmPipeReport.Entity;
- using Core.StlMes.Client.YdmPipeReport.Tool;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.StlMes.Client.YdmPipeReport
- {
- public partial class FrmOrderStock : FrmBase
- {
- private static string[] saleCodes = null;
- public FrmOrderStock()
- {
- IsLoadUserView = true;
- InitializeComponent();
- }
- /// <summary>
- /// 初始化时间
- /// </summary>
- private void InitTime()
- {
- BeginTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddMonths(-1);
- EndTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1).AddSeconds(-1);
- }
- private void FrmOrderStock_Load(object sender, EventArgs e)
- {
- saleCodes = BaseHelper.InitPermissions(this.ValidDataPurviewIds,this.ob);
- InitTime();
- EntityHelper.ShowGridCaption<OrderStockEntity>(GridStorge.DisplayLayout.Bands[0]);
- BaseHelper.setOtherColumnReadOnly(GridStorge, new string[] { "" });
- BaseHelper.InitCellPosition(GridStorge, new string[] { "ActCount", "ActWeight", "BillCount", "BillWeight", "TallCount", "TallWeight", "LoadCount", "LoadWeight", "OnBillCount", "OnBillWeight", "OnTallCount", "OnTallWeight" });
- BaseHelper.GridColumnSum(GridStorge, new string[] { "ActCount", "ActWeight", "BillCount", "BillWeight", "TallCount", "TallWeight", "LoadCount", "LoadWeight", "OnBillCount", "OnBillWeight", "OnTallCount", "OnTallWeight" });
- BaseHelper.setUltraGridColumnMaxInput(GridStorge, new string[] { "ActWeight", "BillWeight", "TallWeight", "LoadWeight", "OnBillWeight", "OnTallWeight" });
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- DoQuery();
- break;
- case "Export":
- GridHelper.ulGridToExcel(GridStorge, "出库跟踪信息");
- break;
- case "Close":
- this.Close();
- break;
- default:
- break;
- }
- }
- private void DoQuery()
- {
- string orderNo = "";
- if (ChcOrderNo.Checked)
- {
- orderNo = TxtOrderNo.Text.Trim();
- }
- string beginTime = "";
- string endTime = "";
- if (ChcTime.Checked && BeginTime.Value != null && EndTime.Value != null)
- {
- beginTime = BeginTime.Value.ToString();
- endTime = EndTime.Value.ToString();
- }
- List<OrderStockEntity> listSource = EntityHelper.GetData<OrderStockEntity>(
- "com.steering.pss.ydm.Report.FrmOrderStock.getOrderStockInfo", new object[] { orderNo, beginTime, endTime, saleCodes }, this.ob);
- orderStockEntityBindingSource.DataSource = listSource;
- setValue();
- }
- private void ChcOrderNo_CheckedChanged(object sender, EventArgs e)
- {
- if (ChcOrderNo.Checked)
- {
- TxtOrderNo.ReadOnly = false;
- }
- else
- {
- TxtOrderNo.ReadOnly = true;
- }
- if (ChcTime.Checked)
- { BeginTime.Enabled = true; EndTime.Enabled = true; }
- else
- { BeginTime.Enabled = false; EndTime.Enabled = false; }
- }
- private void setValue()
- {
- foreach (UltraGridRow ugr in GridStorge.Rows)
- {
- ugr.Cells["OnBillCount"].Value = Convert.ToDouble(ugr.Cells["BillCount"].Text) - Convert.ToDouble(ugr.Cells["LoadCount"].Text);
- ugr.Cells["OnBillWeight"].Value = Convert.ToDouble(ugr.Cells["BillWeight"].Text) - Convert.ToDouble(ugr.Cells["LoadWeight"].Text);
- ugr.Cells["OnTallCount"].Value = Convert.ToDouble(ugr.Cells["TallCount"].Text) - Convert.ToDouble(ugr.Cells["LoadCount"].Text);
- ugr.Cells["OnTallWeight"].Value = Convert.ToDouble(ugr.Cells["TallWeight"].Text) - Convert.ToDouble(ugr.Cells["LoadWeight"].Text);
- }
- }
- }
- }
|