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 com.steering.pss.plnsaleord.processOrder.entity; using Core.Mes.Client.Comm.Control; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.PlnSaleOrd.BaseMethod; using CoreFS.CA06; namespace Core.StlMes.Client.PlnSaleOrd { public partial class FrmJgxSInfo : FrmBase { private static string Message = ""; public FrmJgxSInfo() { this.IsLoadUserView = true; InitializeComponent(); } private void FrmJgxSInfo_Load(object sender, EventArgs e) { EntityHelper.ShowGridCaption(ultraGridJgxSInfo.DisplayLayout.Bands[0]); BaseHelper.setOtherColumnReadOnly(ultraGridJgxSInfo,new string[]{"PlineName"}); BaseHelper.setColumnBackColor(ultraGridJgxSInfo, new string[] { "PlineName" }); BaseHelper.InitCellPosition(ultraGridJgxSInfo, new string[] { "RemainDay1", "RemainDay2", "RemainDay3", "Wgt1", "Wgt2", "Wgt3", "PlanWgt1", "PlanWgt2", "PlanWgt3" }); BaseHelper.setUltraGridColumnBits(ultraGridJgxSInfo, new string[] { "Wgt1", "Wgt2", "Wgt3", "PlanWgt1", "PlanWgt2", "PlanWgt3" }); BaseHelper.MergedCell(ultraGridJgxSInfo, new string[] { "GroupPlan" }); BaseHelper.GridColumnSum(ultraGridJgxSInfo, new string[] { "Wgt1", "Wgt2", "Wgt3", "PlanWgt1", "PlanWgt2", "PlanWgt3" }); InitrepairPlan(); InitGird(); Query(); } private void InitGird() { int month1=DateTime.Parse(dateTimeMonth.Value.ToString()).Month; int month2 = DateTime.Parse(dateTimeMonth.Value.ToString()).AddMonths(1).Month; int month3 = DateTime.Parse(dateTimeMonth.Value.ToString()).AddMonths(2).Month; this.ultraGridJgxSInfo.DisplayLayout.Bands[0].Groups["NewGroup0"].Header.Caption = month1.ToString() + "月份"; this.ultraGridJgxSInfo.DisplayLayout.Bands[0].Groups["NewGroup1"].Header.Caption = month2.ToString() + "月份"; this.ultraGridJgxSInfo.DisplayLayout.Bands[0].Groups["NewGroup2"].Header.Caption = month3.ToString() + "月份"; } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "Query"://查询 Query(); break; case "Export": //导出 GridHelper.ulGridToExcel(ultraGridJgxSInfo, "加工排产信息"); break; case "Close": //关闭 this.Close(); break; default: break; } } /// /// 初始化计划分组 /// private void InitrepairPlan() { DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.FrmJgxSInfo.getRepairPlan",new object[]{"2004"},this.ob); comRepairPlan.DataSource = dt; comRepairPlan.DisplayMember = "BASENAME"; comRepairPlan.ValueMember = "BASECODE"; } private void Query() { string repairPlanCode = ""; if (chcRepairPlan.Checked&&comRepairPlan.Value!=null) { repairPlanCode = comRepairPlan.Value.ToString(); } if (dateTimeMonth.Value == null) { Message = "请输入正确的时间格式!"; MessageUtil.ShowTips(Message); return; } string dateTime = Convert.ToDateTime(dateTimeMonth.Value.ToString()).ToString("yyyy-MM-dd"); InitGird(); List listSource = EntityHelper.GetData ("com.steering.pss.plnsaleord.processOrder.FrmJgxSInfo.getPlanInfo", new object[] { repairPlanCode,dateTime,this.ValidDataPurviewIds }, this.ob); frmJgxsInfoEntityBindingSource.DataSource = listSource; } private void ultraGridJgxSInfo_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { if (e.Cell.Column.Key.Equals("PlineName")) { FrmPlnOrderJgxS frmPlnOrderJgxS = new FrmPlnOrderJgxS( e.Cell.Row.Cells["PlineCode"].Value.ToString(),UserInfo.GetUserName(), this.ob); frmPlnOrderJgxS.ShowDialog(); Query(); } } private void chcRepairPlan_CheckedChanged(object sender, EventArgs e) { if (chcRepairPlan.Checked) { comRepairPlan.Enabled = true; } else { comRepairPlan.Enabled = false; } } } }