| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662 |
- 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 System.Collections;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmStuffReport.Entity;
- using Core.StlMes.Client.YdmStuffManage;
- using Infragistics.Win.UltraWinGrid;
- namespace Core.StlMes.Client.YdmStuffReport
- {
- public partial class FrmStoreSummary : FrmBase
- {
- public FrmStoreSummary()
- {
- InitializeComponent();
- }
- ArrayList alistChecked = null;
- private string[] arr = null;//仓库权限
- private string[] belongArr = null;//所属权权限
- private void FrmStoreSummary_Load(object sender, EventArgs e)
- {
-
- //getStoreAll();
- InitBindColumn();
- arr = BaseMethod.WarehousePermissionsStore(this.ValidDataPurviewIds, this.ob);
- belongArr = this.ValidDataPurviewIds;
- EntityHelper.ShowGridCaption<MatGpMEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- try
- {
- alistChecked = new ArrayList();
- alistChecked.Add("StoveNo");
- alistChecked.Add("JudgeStoveNo");
- alistChecked.Add("MaterialName");
- alistChecked.Add("FixNum");
- alistChecked.Add("ActLen");
- alistChecked.Add("SoureName");
- alistChecked.Add("Dimater");
- alistChecked.Add("Gradename");
- alistChecked.Add("OrderNo");
- alistChecked.Add("MatStatus");
- alistChecked.Add("StorageName");
- alistChecked.Add("IsDealer");
- alistChecked.Add("BackFlag");
- alistChecked.Add("LocationName");
- alistChecked.Add("JudgeResultCode");
- alistChecked.Add("InstockTime");
- alistChecked.Add("Memo");
- alistChecked.Add("BelongName");
- alistChecked.Add("PlineName");
- alistChecked.Add("PlanMemo");
- }
- catch { }
- try
- {
- ArrayList alist = new ArrayList();
- alist.Add("ActCount");
- alist.Add("ActWeight");
- CommonMethod.GeneralCheckedListboxItems(ref this.myCheckedListBox1, ref this.ultraGrid1, alist, alistChecked);
- }
- catch { }
- }
- /// <summary>
- /// 字段绑定
- /// </summary>
- private void InitBindColumn()
- {
- //材料状态
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150101", "材料产出等待");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150102", "材料管理封锁");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150103", "材料质量封锁");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150104", "材料可编计划");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150105", "材料已编计划");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150106", "材料为余材");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150201", "材料产出等待(未综合判定)");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150202", "材料产出(已综合判定");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150203", "材料为余材(已综合判定)");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150204", "材料脱单余材(销售组织脱单)");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150301", "材料可编计划(发运控制)");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150302", "材料已编计划(发运控制)");
- this.ultraGrid1.DisplayLayout.ValueLists[0].ValueListItems.Add("80150303", "销售出厂");
- //材料类别
- this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801401", "在制品");
- this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801402", "成品");
- this.ultraGrid1.DisplayLayout.ValueLists[1].ValueListItems.Add("801403", "商品");
- DataTable ds = ClsLoad.GetValueListDataTable("8014", this.ob);
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["ProductFlag"].ValueList = ClsLoad.GeneralValuelist(ref ds, "BASECODE", "BASENAME");
- string[] arr = new string[3] { "801501", "801502", "801503" };
- DataTable dt = ClsLoad.GetValueListDataTable(arr, this.ob);
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["MatStatus"].ValueList = ClsLoad.GeneralValuelist(ref dt, "BASECODE", "BASENAME");
- }
- /// <summary>
- /// 获取仓库
- /// </summary>
- private void getStoreAll()
- {
- string storeNo = "800201";
- //string[] arr = BaseMethod.WarehousePermissions(this.CustomInfo, this.ValidDataPurviewIds, this.ob);
- //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 "SavePlanMemo":
- SavePlanMemo();
- break;
- case "Export":
- ExportData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 保存计划备注
- /// </summary>
- private void SavePlanMemo()
- {
-
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void QueryData()
- {
- List<MatGpMEntity> listSource = null;
-
- if (chkStoveNo.Checked && string.IsNullOrEmpty(this.txtStoveNo.Text))
- {
- MessageUtil.ShowTips("请输入熔炼炉号!");
- this.txtStoveNo.Focus();
- return;
- }
- if (chkJudgeNo.Checked && string.IsNullOrEmpty(this.txtJudgeNo.Text))
- {
- MessageUtil.ShowTips("请输入判定炉号!");
- this.txtJudgeNo.Focus();
- return;
- }
- string stoveNo = "";
- string judgeNo = "";
- string orderNo = "";
- string grade = "";
- string dimter = "";
- string sourceName = "";
- ArrayList list = new ArrayList();
- string strSql = "";
- string strGroup = "";
- string strOut = "";
- if (chkStoveNo.Checked)
- {
- stoveNo = this.txtStoveNo.Text.Trim();
- strOut += " AND T1.STOVE_NO = '" + stoveNo + "'";
- }
- if(chkJudgeNo.Checked)
- {
- judgeNo = this.txtJudgeNo.Text.Trim();
- strOut += " AND T1.JUDGE_STOVE_NO = '" + judgeNo + "'";
- }
- if (chkOrder.Checked)
- {
- orderNo = this.txtOrder.Text.Trim();
- strOut += " AND S1.ORDER_NO||'/'||S1.ORDER_SEQ LIKE '%" + orderNo + "'";
- }
- if(chkSource.Checked)
- {
- sourceName = this.txtSource.Text.Trim();
- strOut += " AND T1.SOURE_NAME LIKE '%" + sourceName + "'";
- }
- if(chkDimter.Checked)
- {
- dimter = this.txtDimter.Text.Trim();
- strOut += " AND T1.DIMATER LIKE '%" + dimter + "'";
- }
- if(chkGrade.Checked)
- {
- grade = this.txtGrade.Text.Trim();
- strOut += " AND T1.GRADENAME LIKE '%" + grade + "'";
- }
- string strKey = "";
- CheckBox item;
- for (int i = 0; i < this.myCheckedListBox1.Controls.Count; i++)
- {
- try
- {
- item = this.myCheckedListBox1.Controls[i] as CheckBox;
- if (item != null && item.Checked)
- {
- strKey = item.Name;
- if (strKey.Equals("StoveNo"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.STOVE_NO";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.STOVE_NO";
- }
- else if (strKey.Equals("PlanMemo"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(T1.PLAN_MEMO) PLAN_MEMO";
- // strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "MAX(T1.PLAN_MEMO) PLAN_MEMO";
- }
- else if (strKey.Equals("JudgeStoveNoLg"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.JUDGE_STOVE_NO_LG";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_STOVE_NO_LG";
- }
- else if (strKey.Equals("JudgeStoveNo"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.JUDGE_STOVE_NO";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_STOVE_NO";
- }
- else if (strKey.Equals("MaterialName"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MATERIAL_NAME";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MATERIAL_NAME";
- }
- else if (strKey.Equals("Gradename"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.GRADENAME";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.GRADENAME";
- }
- else if (strKey.Equals("StdName"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.STD_NAME";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.STD_NAME";
- }
- else if (strKey.Equals("Dimater"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.DIMATER";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.DIMATER";
- }
- else if (strKey.Equals("FixNum"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.FIX_NUM";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.FIX_NUM";
- }
- else if (strKey.Equals("FixLen"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.FIX_LEN";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.FIX_LEN";
- }
- else if (strKey.Equals("ActLen"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.ACT_LEN";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.ACT_LEN";
- }
- else if (strKey.Equals("CutNum1"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "ROUND(T1.ACT_LEN/2,1)CUT_NUM1";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "ROUND(T1.ACT_LEN/2,1)";
- }
- else if (strKey.Equals("CutNum2"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "ROUND(T1.ACT_LEN/3,1)CUT_NUM2";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "ROUND(T1.ACT_LEN/3,1)";
- }
- else if (strKey.Equals("CutNum3"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "ROUND(T1.ACT_LEN/4,1)CUT_NUM3";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "ROUND(T1.ACT_LEN/4,1)";
- }
- else if (strKey.Equals("CutNum4"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "ROUND(T1.ACT_LEN/5,1)CUT_NUM4";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "ROUND(T1.ACT_LEN/5,1)";
- }
- else if (strKey.Equals("BelongName"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.BELONG_NAME";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.BELONG_NAME";
- }
- else if (strKey.Equals("JudgeResultCode"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T2.BASENAME FROM COM_BASE_INFO T2 WHERE T2.BASECODE = T1.JUDGE_RESULT_CODE )JUDGE_RESULT_CODE";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_RESULT_CODE";
- }
- else if (strKey.Equals("InstockTime"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(TO_CHAR(T1.INSTOCK_TIME,'YYYY-MM-DD HH24:MI:SS'))INSTOCK_TIME";
- //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.JUDGE_RESULT_CODE";
- }
- else if (strKey.Equals("ProductFlag"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PRODUCT_FLAG";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PRODUCT_FLAG";
- }
- else if (strKey.Equals("MatStatus"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MAT_STATUS";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MAT_STATUS";
- }
- else if (strKey.Equals("PlineName"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.PLINE_NAME";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.PLINE_NAME";
- }
- else if (strKey.Equals("QcmStaus"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(T1.QCM_STAUS,'00','合格','11','待处理','22','废品')QCM_STAUS";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.QCM_STAUS";
- }
- else if (strKey.Equals("StorageName"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "(SELECT T3.STORAGE_NAME FROM YDM_BS_STORAGE T3 WHERE T3.STORAGE_NO = T2.STORAGE_NO)STORAGE_NAME";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.STORAGE_NO";
- }
- else if (strKey.Equals("LocationName"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T2.LOCATION_NAME";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.LOCATION_NAME";
- }
- else if (strKey.Equals("LaryNo"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T2.LARY_NO";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T2.LARY_NO";
- }
- else if (strKey.Equals("OrderNo"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "S1.ORDER_NO||'/'||S1.ORDER_SEQ AS ORDER_NO";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.ORDER_NO,S1.ORDER_SEQ";
- }
- //else if (strKey.Equals("QcmMemo"))
- //{
- // strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT T.MEMO FROM QCM_GP_JUDGE_APPLY T WHERE T.JUGDE_APPLY_CODE || T.JUGDE_APPLY_SQE = T1.JUGDE_APPLY_CODE GROUP BY T.JUGDE_APPLY_CODE,T.JUGDE_APPLY_SQE,T.MEMO))QCM_MEMO";
- // //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.ORDER_NO,S1.ORDER_SEQ";
- //}
- //else if (strKey.Equals("JudgeMemo"))
- //{
- // strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT T.JUDGE_MEMO FROM QCM_GP_JUDGE_APPLY T WHERE T.JUGDE_APPLY_CODE || T.JUGDE_APPLY_SQE = T1.JUGDE_APPLY_CODE GROUP BY T.JUGDE_APPLY_CODE,T.JUGDE_APPLY_SQE,T.JUDGE_MEMO))JUDGE_MEMO";
- // //strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "S1.ORDER_NO,S1.ORDER_SEQ";
- //}
- else if (strKey.Equals("PlineNameNext"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX((SELECT S1.PLINE_NAME FROM PLN_ORDER_ZG_S S1 WHERE S1.PRO_PLAN_ID = T1.PRO_PLAN_ID_ZG AND S1.GX_PLAN_NO = T1.GX_PLAN_NO_ZG))PLINE_NAME_NEXT";
- }
- else if (strKey.Equals("PlanTimeB"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "MAX(S1.PLAN_TIME_B) PLAN_TIME_B";
- }else if(strKey.Equals("Memo"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.MEMO";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.MEMO";
- }else if(strKey.Equals("SoureName"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "T1.SOURE_NAME";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.SOURE_NAME";
- }
- else if (strKey.Equals("IsDealer"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + "DECODE(T1.IS_DEALER,'0','自用','1','双经销','2','来料加工','3','定销订购')IS_DEALER";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.IS_DEALER";
- }
- else if(strKey.Equals("BackFlag"))
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",") + " DECODE(T1.BACK_FLAG,'0','正常坯','1','回炉坯','2','套尺坯','3','掉队坯')BACK_FLAG";
- strGroup += (string.IsNullOrEmpty(strGroup) ? "" : ",") + "T1.BACK_FLAG";
- }
-
- else
- {
- strSql += (string.IsNullOrEmpty(strSql) ? "t." : ",t.") + strKey;
- strGroup += (string.IsNullOrEmpty(strGroup) ? "t." : ",t.") + strKey;
- }
- }
- }
- catch { }
- }
- strSql += (string.IsNullOrEmpty(strSql) ? "" : ",");
- strGroup = (string.IsNullOrEmpty(strGroup) ? "" : "group by ") + strGroup;
- string _sql = strOut + strGroup;
- list.Add(strSql);
- list.Add(strOut);
- list.Add(strGroup);
- switch (this.CustomInfo)
- {
- case "STORAGE_NO":
- listSource = EntityHelper.GetData<MatGpMEntity>(
- "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary.queryData", new object[] { list, arr }, this.ob);
- break;
- case "BELONG_CODE":
- listSource = EntityHelper.GetData<MatGpMEntity>(
- "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary.queryDataBelong", new object[] { list, belongArr }, this.ob);
- break;
- case "120501":
- listSource = EntityHelper.GetData<MatGpMEntity>(
- "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary.queryDataAll", new object[] { list,this.CustomInfo}, this.ob);
- break;
- case "120504":
- listSource = EntityHelper.GetData<MatGpMEntity>(
- "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary.queryDataAll", new object[] { list, this.CustomInfo }, this.ob);
- break;
- }
-
- MatGpMEntitybindingSource.DataSource = listSource;
-
- bool bContains = false, bChecked = false;
- for (int i = 0; i < this.ultraGrid1.DisplayLayout.Bands[0].Columns.Count; i++)
- {
- try
- {
- bContains = false;
- strKey = this.ultraGrid1.DisplayLayout.Bands[0].Columns[i].Key;
- for (int j = 0; j < this.myCheckedListBox1.Controls.Count; j++)
- {
- try
- {
- item = this.myCheckedListBox1.Controls[j] as CheckBox;
- if (item.Name.Equals(strKey))
- {
- bContains = true;
- bChecked = item.Checked;
- break;
- }
- }
- catch { }
- }
- if (bContains)
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Columns[i].Hidden = !bChecked;
- }
- }
- catch { }
- }
- this.SetStaticsInfo();
- CommonMethod.SetGridSumArea(this.ultraGrid1);
- }
- private void SetStaticsInfo()
- {
- try
- {
- if (this.ultraGrid1.Rows.Count == 0)
- {
- this.ultraGrid1.DisplayLayout.Bands[0].Summaries.Clear();
- }
- else
- {
- ArrayList alist = new ArrayList();
- alist.Add("ActCount");
- alist.Add("ActWeight");
- CommonMethod.SetStaticsInfoSum(ref this.ultraGrid1, alist, true);
- }
- }
- catch { }
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void ExportData()
- {
- GridHelper.ulGridToExcel(ultraGrid1, "管坯库存汇总");
- }
- /// <summary>
- /// 全选
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void myLinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- this.myCheckedListBox1.CheckAll();
- }
- /// <summary>
- /// 清除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void myLinkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- this.myCheckedListBox1.UnCheckAll();
- }
- /// <summary>
- /// 默认
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void myLinkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- CheckBox items;
- for (int i = 0; i < this.myCheckedListBox1.Controls.Count; i++)
- {
- try
- {
- items = this.myCheckedListBox1.Controls[i] as CheckBox;
- if (alistChecked.Contains(items.Name))
- {
- items.Checked = true;
- }
- else
- {
- items.Checked = false;
- }
- }
- catch { }
- }
- }
- private void cbx_GroupBy_CheckedChanged(object sender, EventArgs e)
- {
- CommonMethod.SetGridGroupBy(ref this.ultraGrid1, cbx_GroupBy.Checked);
- CommonMethod.SetGridSumArea(this.ultraGrid1);
- }
- private void chkStoveNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtStoveNo.Enabled = this.chkStoveNo.Checked;
- }
- private void chkJudgeNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtJudgeNo.Enabled = this.chkJudgeNo.Checked;
- }
- private void txtStoveNo_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryData();
- }
- }
- private void txtJudgeNo_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryData();
- }
- }
- private void txtOrder_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryData();
- }
- }
- private void chkOrder_CheckedChanged(object sender, EventArgs e)
- {
- this.txtOrder.Enabled = this.chkOrder.Checked;
- }
- private void chkSource_CheckedChanged(object sender, EventArgs e)
- {
- this.txtSource.Enabled = this.chkSource.Checked;
- }
- private void chkGrade_CheckedChanged(object sender, EventArgs e)
- {
- this.txtGrade.Enabled = this.chkGrade.Checked;
- }
- private void chkDimter_CheckedChanged(object sender, EventArgs e)
- {
- this.txtDimter.Enabled = this.chkDimter.Checked;
- }
- private void txtSource_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryData();
- }
- }
- private void txtGrade_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryData();
- }
- }
- private void txtDimter_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryData();
- }
- }
- private void ultraGrid1_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- if (e.Cell.Column.Key.Equals("PlanMemo"))
- {
- UltraGridRow row = ultraGrid1.ActiveRow;
- if (MessageUtil.ShowYesNoAndQuestion("是否保存当前计划备注?") == DialogResult.No)
- return;
- CoreClientParam ccp = new CoreClientParam();
- string matStatus = row.Cells["matStatus"].Text.ToString().Trim().Equals("材料产出待判")?"80150101":
- row.Cells["matStatus"].Text.ToString().Trim().Equals("材料产出(已判定)")? "80150102":
- row.Cells["matStatus"].Text.ToString().Trim().Equals("材料已编计划")?"80150103":"";
- ccp.ServerName = "Core.LgMes.Server.Stuffmanage.Report.FrmStoreSummary";
- ccp.MethodName = "updatePlanMemo";
- ccp.ServerParams = new object[] { row.Cells["judgeStoveNo"].Text.ToString().Trim(),
- row.Cells["fixNum"].Text.ToString().Trim(),
- row.Cells["actLen"].Text.ToString().Trim(),
- row.Cells["actCount"].Text.ToString().Trim(),
- row.Cells["planMemo"].Text.ToString().Trim(),
- row.Cells["locationName"].Text.ToString().Trim(),
- row.Cells["memo"].Text.ToString().Trim(),
- row.Cells["orderNo"].Text.ToString().Trim(),
- matStatus,
- row.Cells["stoveNo"].Text.ToString().Trim()
- };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- QueryData();
- // doQueryActual(proPlanId, gxPlanNo);
- }
- }
- }
-
- }
- }
|