using System;
using System.Collections;
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.Format;
using Core.Mes.Client.Comm.Server;
using Core.Mes.Client.Comm.Tool;
using Core.StlMes.Client.PlnSaleOrd.BaseMethod;
using Core.StlMes.Client.PlnSaleOrd.工序排产;
using Core.StlMes.Client.PlnSaleOrd.工序排产.entity;
using CoreFS.CA06;
using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;
using Infragistics.Win.UltraWinGrid;
using Core.StlMes.Client.PlnSaleOrd.OrderManage.froms;
using Newtonsoft.Json;
using Core.StlMes.Client.PlnSaleOrd.窗体;
using Core.Mes.Client.Comm;
using Core.StlMes.Client.PlnSaleOrd.PopupWindow;
using Core.StlMes.Client.PlnSaleOrd.炉计划.Entity;
using Core.StlMes.Client.PlnSaleOrd.炉计划.Tool;
namespace Core.StlMes.Client.PlnSaleOrd
{
///custominfo==0 表示轧管排产查询界面
///
/// 轧制排产
///
public partial class FrmPlnOrderZgSEasy : FrmBase
{
private string departm = "";//获取部门ID
private string[] plineCode = null;//获取产线代码
///
/// 订单编号
///
private string _ProPlanId = "";
DataTable dtPlinGroup = null;
///
/// 排产序号
///
private string _GxPlanNo = "";
UltraComboEditor uceDimaM = new UltraComboEditor();//芯棒直径
///
/// 行首背景色
///
private Color _backColor = new Color();
string proPlanId = "";
string gxPlanNo = "";
///
/// 调整行集合
///
private ArrayList _entityList = null;
public FrmPlnOrderZgSEasy()
{
InitializeComponent();
this.IsLoadUserView = true;
}
public override void ToolBar_Click(object sender, string ToolbarKey)
{
base.ToolBar_Click(sender, ToolbarKey);
switch (ToolbarKey)
{
case "Query"://查询
Query();
break;
case "Export":
GridHelper.ulGridToExcel(ultraGridZgS, "轧管排产二级信息", true);
break;
case "Close": //关闭
this.Close();
break;
default:
break;
}
}
private void FrmPlnOrderZgS_Load(object sender, EventArgs e)
{
GridHelper.SetAllColumnsActive(ultraGridZgS);
plineCode = PlanHelper.InitDropPlinePower("D", comPline, this.ValidDataPurviewIds, this.ob);
InitTime();
comPline.SelectedIndex = 0;
}
private void InitTime()
{
DateTime now = DateTime.Now;
DateTime d1 = new DateTime(now.Year, now.Month, 1);
DateTime d2 = d1.AddMonths(1).AddSeconds(-1);
txtPlanTimeB1.Value = d1;
txtPlanTimeB2.Value = d2;
txtPlanTimeE1.Value = d1;
txtPlanTimeE2.Value = d2;
}
private void Query()
{
if (plineCode == null)
{
MessageUtil.ShowTips("该用户没有轧管产线查看权限!");
return;
}
var Message = "";
var wf = new WaitingForm2("正在查询,请稍候....");
try
{
Cursor = Cursors.WaitCursor;
//产线
string comPlineCode = "";
if (chcPline.Checked)
{
comPlineCode = comPline.Value == null ? "" : comPline.Value.ToString();
}
//执行状态
string[] statusArr = contorlPlanStatus1.statusArr;
//合同号
string orderNo = "";
if (chcOrderNo.Checked) { orderNo = txtOrderNo.Text.Trim(); }
string proPlanId = "";
if (chcProPlanId.Checked) { proPlanId = txtProPlanId.Text.Trim(); }
string planTimeB1 = "";
string planTimeB2 = "";
if (chcPlanTimeB.Checked && txtPlanTimeB2.Value != null && txtPlanTimeB1.Value != null)
{
planTimeB1 = DateTime.Parse(txtPlanTimeB1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
planTimeB2 = DateTime.Parse(txtPlanTimeB2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
}
string planTimeE1 = "";
string planTimeE2 = "";
if (chcPlanTimeE.Checked && txtPlanTimeE2.Value != null && txtPlanTimeE1.Value != null)
{
planTimeE1 = DateTime.Parse(txtPlanTimeE1.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
planTimeE2 = DateTime.Parse(txtPlanTimeE2.Value.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
}
DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.queryPlanOrderDEasy", new Object[] { plineCode, proPlanId, orderNo, statusArr, planTimeB1, planTimeB2, planTimeE1, planTimeE2, comPlineCode }, this.ob);
GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
GridHelper.RefreshAndAutoSizeExceptColumns(ultraGridZgS, "");
}
catch (Exception ex)
{
if (ex.Message.ToString2() != "")
Message = ex.Message;
}
finally
{
wf.Close();
Cursor = Cursors.Default;
}
if (!string.IsNullOrWhiteSpace(Message))
MessageBox.Show(Message);
}
private void chcPline_CheckedChanged(object sender, EventArgs e)
{
if (chcPline.Checked) { comPline.ReadOnly = false; } else { comPline.ReadOnly = true; }
if (chcOrderNo.Checked) { txtOrderNo.ReadOnly = false; } else { txtOrderNo.ReadOnly = true; }
if (chcProPlanId.Checked) { txtProPlanId.ReadOnly = false; } else { txtProPlanId.ReadOnly = true; }
if (chcPlanTimeB.Checked) { txtPlanTimeB1.ReadOnly = false; txtPlanTimeB2.ReadOnly = false; } else { txtPlanTimeB1.ReadOnly = true; txtPlanTimeB2.ReadOnly = true; }
if (chcPlanTimeE.Checked) { txtPlanTimeE1.ReadOnly = false; txtPlanTimeE2.ReadOnly = false; } else { txtPlanTimeE1.ReadOnly = true; txtPlanTimeE2.ReadOnly = true; }
}
private void comPline_ValueChanged(object sender, EventArgs e)
{
if (comPline == null)
{ return; }
else
{ if (!CustomInfo.Equals("0")) { } }
}
}
}