| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- 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 System.Collections;
- using Core.Mes.Client.Comm.Tool;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.StlMes.Client.ZGMil.Entity;
- using Core.StlMes.Client.ZGMil.Signature;
- using Core.StlMes.Client.ZGMil.ResultConrtrol;
- using Core.StlMes.Client.ZGMil.Common;
- using Infragistics.Win.UltraWinGrid;
- using com.steering.mes.zgmil.entity;
- using Core.Mes.Client.Comm.Format;
- namespace Core.StlMes.Client.ZGMil.Report
- {
- public partial class FrmAnnularFurnace : FrmBase
- {
- private string departm = "";
- private string plineCode = "";
- private string[] plineCodes = { };
- public FrmAnnularFurnace()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmAnnularFurnace_Load(object sender, EventArgs e)
- {
- cmbDate.Value = DateTime.Parse(DateTime.Today.ToString());
- NativeMethodNew na = new NativeMethodNew(this.ob);
- departm = UserInfo.GetDepartment();
- plineCode = na.GetPCode(departm);//获取 用户 对应的产线
- plineCodes = BaseMethod.GetPlineCode(ValidDataPurviewIds, ob);
- cmbEndDate.Value = DateTime.Parse(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd 21:00:00"));
- cmbDate.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 20:59:59"));
- TubeRoll.SetComboItemHeight(cmbBc);
- TubeRoll.SetComboItemHeight(cmbBz);
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQuery();
- break;
- case "Save":
- doSave("入炉修改");
- break;
- case "AfterDoSave":
- doSave("出炉修改");
- break;
- case "Export":
- doExport();
- break;
- case "ExportData":
- GridHelper.ulGridToExcel(ultraGrid1, "环形加热炉台账");
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 修改
- /// </summary>
- private void doSave(String remarkState)
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要修改的信息!");
- return;
- }
- ArrayList parm = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- FeedSawResultEntity matZcTity = new FeedSawResultEntity();
- matZcTity.JudgeStoveNo = uRow.Cells["JUDGE_STOVE_NO"].Text.ToString();
- matZcTity.PlineCode = uRow.Cells["PLINE_CODE"].Text.ToString();
- if (uRow.Cells["COL_SHIFT"].Value.ToString().Equals("早班"))
- {
- matZcTity.ColShift = "1";
- }
- else if (uRow.Cells["COL_SHIFT"].Value.ToString().Equals("中班"))
- {
- matZcTity.ColShift = "2";
- }
- else if (uRow.Cells["COL_SHIFT"].Value.ToString().Equals("夜班"))
- {
- matZcTity.ColShift = "3";
- }
- else if (uRow.Cells["COL_SHIFT"].Value.ToString().Equals("常白班"))
- {
- matZcTity.ColShift = "0";
- }
- else
- {
- matZcTity.ColShift = uRow.Cells["COL_SHIFT"].Value.ToString();
- }
- if (uRow.Cells["COL_GROUP"].Value.ToString().Equals("甲"))
- {
- matZcTity.ColGroup = "1";
- }
- else if (uRow.Cells["COL_GROUP"].Value.ToString().Equals("乙"))
- {
- matZcTity.ColGroup = "2";
- }
- else if (uRow.Cells["COL_GROUP"].Value.ToString().Equals("丙"))
- {
- matZcTity.ColGroup = "3";
- }
- else if (uRow.Cells["COL_GROUP"].Value.ToString().Equals("丁"))
- {
- matZcTity.ColGroup = "4";
- }
- else
- {
- matZcTity.ColGroup = uRow.Cells["COL_GROUP"].Value.ToString();
- }
- matZcTity.StartTime = uRow.Cells["START_TIME"].Text.ToString();
- matZcTity.ColUser = uRow.Cells["COL_USER"].Text.ToString();
- matZcTity.Remark = "环形炉";
- matZcTity.RemarkState = remarkState;
- string matTity = JSONFormat.Format(matZcTity);
- parm.Add(matTity);
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No) return;
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.zgmil.report.FrmFeedSaw";
- ccp.MethodName = "doSave";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- doQuery();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void chkDate_CheckedChanged(object sender, EventArgs e)
- {
- if (chkDate.Checked) { cmbDate.Enabled = true; } else { cmbDate.Enabled = false; }
- if (chkBc.Checked) { cmbBc.Enabled = true; } else { cmbBc.Enabled = false; }
- if (chkBz.Checked) { cmbBz.Enabled = true; } else { cmbBz.Enabled = false; }
- }
- private void doQuery()
- {
- ArrayList list = new ArrayList();
- string date = "";
- string endDate = "";
- string bc = "";
- string bz="";
- string JudgeStoveNo = "";
- if (chkDate.Checked)
- {
- if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate.Value.ToString()), DateTime.Parse(cmbEndDate.Value.ToString())) == 0)
- {
- MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!");
- return;
- }
- else
- {
- date = cmbDate.Value.ToString();
- endDate = cmbEndDate.Value.ToString();
- }
- }
- if (chkBz.Checked)
- {
- if (cmbBz.Text.Trim() == "")
- {
- //MessageUtil.ShowTips("班组不能为空!");
- //return;
- bz = "";
- }
- else
- {
- bz = cmbBz.Value.ToString();
- }
- }
- if (chkBc.Checked)
- {
- if (cmbBc.Text.Trim() == "")
- {
- //MessageUtil.ShowTips("班次不能为空!");
- //return;
- bc = "";
- }
- else
- {
- bc = cmbBc.Value.ToString();
- }
- }
- if (chkJudgeStoveNo.Checked)
- {
- if (uteJudgeStoveNo.Text.Trim() == "")
- {
- JudgeStoveNo = "";
- }
- else
- {
- JudgeStoveNo = uteJudgeStoveNo.Value.ToString();
- }
- }
- DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.report.FrmAnnularFurnace.queryMinResult", new Object[] { date, endDate, bc, bz,JudgeStoveNo,plineCodes }, this.ob);
- GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
- GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void doExport()
- {
- string date = "";
- string endDate = "";
- string bc = "";
- string bz = "";
- //if (!chkDate.Checked)
- //{
- // MessageUtil.ShowTips("请选择生产日期!");
- // return;
- //}
- if (!chkBz.Checked)
- {
- MessageUtil.ShowTips("请选择班组!");
- return;
- }
- if (!chkBc.Checked)
- {
- MessageUtil.ShowTips("请选择班次!");
- return;
- }
- if (chkDate.Checked)
- {
- if (DataTimeUtil.JudgeTime(DateTime.Parse(cmbDate.Value.ToString()), DateTime.Parse(cmbEndDate.Value.ToString())) == 0)
- {
- MessageUtil.ShowTips("您所选择的日期区域不对,请重新选择!");
- return;
- }
- else
- {
- date = cmbDate.Value.ToString();
- endDate = cmbEndDate.Value.ToString();
- }
- }
- if (chkBz.Checked)
- {
- if (cmbBz.Text.Trim() == "")
- {
- //MessageUtil.ShowTips("班组不能为空!");
- //return;
- bz = "";
- }
- else
- {
- bz = cmbBz.Value.ToString();
- }
- }
- if (chkBc.Checked)
- {
- if (cmbBc.Text.Trim() == "")
- {
- //MessageUtil.ShowTips("班次不能为空!");
- //return;
- bc = "";
- }
- else
- {
- bc = cmbBc.Value.ToString();
- }
- }
- doQuery();
- ColUserName colU = new ColUserName();
- colU.Ob = this.ob;
- colU.PlineCode = plineCode;
- colU.ColGroup = bz;
- colU.ColOrder = bc;
- colU.StationId = "1";
- if (plineCode.Equals("C017"))//460
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilFurResult460.cpt&format=pdf&__bypagesize__=false";
- }
- else if (plineCode.Equals("C010"))//168
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilFurResult168.cpt&format=pdf&__bypagesize__=false";
- }
- else if (plineCode.Equals("C009"))//258
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilFurResult258.cpt&format=pdf&__bypagesize__=false";
- }
- else if (plineCode.Equals("C008"))//250
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilFurResult250.cpt&format=pdf&__bypagesize__=false";
- }
- else if (plineCode.Equals("C072"))//508
- {
- colU.Url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilFurResult508.cpt&__bypagesize__=false";
- }
- colU.StartTim = date;
- colU.EndTim = endDate;
- colU.StrText = "环形加热炉";
- colU.Flag = "0";
- colU.ShowDialog();
- //string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilFurResult.cpt&format=pdf&__bypagesize__=false&SHIFT=" + bc + "&GROUP=" + bz + "&DATE=" + date + "&DATE2=" + endDate + "&PLINECODE=" + plineCode;
- //FrmRepExcel fre = new FrmRepExcel(this.ob,url);
- ////fre.AutoSize = true;
- //fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- //fre.Text = "环形加热炉";
- //fre.ShowDialog();
- }
- private string cjkEncode(string p)
- {
- throw new NotImplementedException();
- }
- }
- }
|