| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- 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 CoreFS.CA06;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using System.Collections;
- using Core.StlMes.Client.YdmBcPipeManage;
- namespace Core.StlMes.Client.YdmBcPipeManage
- {
- public partial class FrmBcStoveStore : FrmBase
- {
- public FrmBcStoveStore()
- {
- InitializeComponent();
- }
- private string[] belongArr = null;//所属权
- private void FrmStuffStoveStore_Load(object sender, EventArgs e)
- {
- StatTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01" + " 00:00:00");
- endTime.Value = DateTime.Today.AddDays(1).AddSeconds(-1);
- belongArr = this.ValidDataPurviewIds;
- //getStoreAll();
- }
- private void getStoreAll()
- {
- string storeNo = "800201";
- //string[] arr = BaseMethod.
- //DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.Stuffmanage.FrmStuffBase.getStoreAll", new object[] { storeNo, arr }, this.ob);
- //if (dt.Rows.Count > 0)
- //{
- // cmbStorgeNo.DataSource = dt;
- // cmbStorgeNo.DisplayMember = "STORAGE_NAME";
- // cmbStorgeNo.ValueMember = "STORAGE_NO";
- //}
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- QueryData();
- break;
- case"InsertInal":
- insertInal();
- break;
- case "Export":
- ExportData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 结转
- /// </summary>
- private void insertInal()
- {
-
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void QueryData()
- {
- //string[] arr = BaseMethod.WarehousePermissions(this.CustomInfo,this.ValidDataPurviewIds, ob);
- if (this.StatTime.Value > this.endTime.Value)
- {
- MessageUtil.ShowTips("起始年月不能大于结束日期!");
- this.endTime.Focus();
- return;
- }
-
- string strDateFrom = this.StatTime.Value.ToString("yyyyMM");
- string strDateTo = this.endTime.Value.ToString("yyyyMMdd");
- string time = this.StatTime.Value.ToString("yyyyMM");
- string nextStartTime = this.StatTime.Value.AddMonths(1).ToString("yyyyMMdd");
- string nextEndTime = this.endTime.Value.AddMonths(1).ToString("yyyyMMdd");
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- string strOriginal = this.StatTime.Value.ToString("yyyyMM");
- string strOriginalLast = this.endTime.Value.ToString("yyyyMMdd");
- DataTable dt = ServerHelper.GetData("com.steering.ydm.bc.report.FrmBcStoveStore.queryData", new object[] { strOriginal, strOriginalLast, time, belongArr, nextStartTime, nextEndTime }, ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- this.SetStaticsInfo();
- CommonMethod.SetGridSumArea(this.ultraGrid1);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception e)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- }
- private void SetStaticsInfo()
- {
- try
- {
- if (this.ultraGrid1.Rows.Count == 0)
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Summaries.Clear();
- }
- else
- {
- ArrayList alist = new ArrayList();
- alist.Add("ORIGINAL_AMOUNT");
- alist.Add("ORIGINAL_COUNT");
- alist.Add("DAY_1");
- alist.Add("DAY_1COUNT");
- alist.Add("MONTH_1");
- alist.Add("MONTH_1COUNT");
- //alist.Add("YEAR_1");
- alist.Add("DAY_2");
- alist.Add("DAY_2COUNT");
- alist.Add("MONTH_2");
- alist.Add("MONTH_2COUNT");
- //alist.Add("YEAR_2");
- //alist.Add("AWEIGHT");
- alist.Add("END_AMOUNT");
- alist.Add("END_COUNT");
- alist.Add("MATWGT");
- alist.Add("MATCOUNT");
- alist.Add("QUANTITYCOUNT");
- alist.Add("QUANTITYWGT");
- alist.Add("NEXTMOTH_COUNT");
- alist.Add("NEXTMOTH_WEIGHT");
- alist.Add("CNEXTMOTH_COUNT");
- alist.Add("CNEXTMOTH_WEIGHT");
- CommonMethod.SetStaticsInfoSum(ref this.ultraGrid1, alist, true);
- }
- }
- catch { }
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void ExportData()
- {
- GridHelper.ulGridToExcel(ultraGrid1, "半成品收发存汇总");
- }
- }
- }
|