/// <summary> /// 构造函数 /// </summary> public LotCreateViewContent(LotCreateDetailModel model, bool isBatch) : base() { this.IsBatch = isBatch; if (isBatch) { this.TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotCreateViewContent.Title01}");//"创建生产批次"; //视图标题。 } else { this.TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotCreateViewContent.Title02}");//"创建补片批次"; //视图标题。 } //define panel Panel panel = new Panel(); //set panel dock style panel.Dock = DockStyle.Fill; //set panel BorderStyle panel.BorderStyle = BorderStyle.FixedSingle; //创建批次创建的控件对象 LotCreate ctrl = new LotCreate(model, isBatch, this); ctrl.Dock = DockStyle.Fill; //将控件对象加入到Panel中。 //设置Panel为该视图对象的控件对象,用于在应用程序平台上显示可视化的视图界面。 panel.Controls.Add(ctrl); //set panel to view content this.control = panel; }
/// <summary> /// 构造函数 /// </summary> public LotCreateDetailViewContent(LotCreateDetailModel model, bool isBatch) : base() { if (isBatch) { this.TitleName = "创建生产批次"; //视图标题。 } else { this.TitleName = "创建补片批次"; //视图标题。 } //define panel Panel panel = new Panel(); //set panel dock style panel.Dock = DockStyle.Fill; //set panel BorderStyle panel.BorderStyle = BorderStyle.FixedSingle; //创建批次创建的控件对象 LotCreateDetail ctrl = new LotCreateDetail(model, isBatch, this); ctrl.Dock = DockStyle.Fill; //将控件对象加入到Panel中。 //设置Panel为该视图对象的控件对象,用于在应用程序平台上显示可视化的视图界面。 panel.Controls.Add(ctrl); //set panel to view content this.control = panel; }
private string MESSAGEBOX_CAPTION = StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotDispatch.INFORMATION}"); //提示 /// <summary> /// 构造函数 /// </summary> public LotCreate(LotCreateDetailModel model, bool isBatch, IViewContent view) { InitializeComponent(); this._isBatch = isBatch; this._view = view; this._model = model; InitializeLanguage(); }
/// <summary> /// 确认按钮事件方法。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsbOK_Click(object sender, EventArgs e) { this._model = new LotCreateDetailModel(); this._model.RoomKey = Convert.ToString(this.cbFactoryRoom.EditValue); this._model.RoomName = this.cbFactoryRoom.Text; this._model.OperationName = this.cbOperation.Text; this._model.StoreMaterialDetailKey = Convert.ToString(this.lueReceiveItemNo.EditValue); this._model.ReceiveItemNo = Convert.ToString(this.lueReceiveItemNo.Text); this._model.ProId = Convert.ToString(this.lueReceiveItemNo.GetColumnValue("PRO_ID")); this._model.MaterialCode = Convert.ToString(this.lueReceiveItemNo.GetColumnValue("MATNR")); this._model.SupplierName = Convert.ToString(this.lueReceiveItemNo.GetColumnValue("SUPPLIER_NAME")); this._model.OrderNo = Convert.ToString(this.cbOrderNumber.EditValue); this._model.OrderKey = Convert.ToString(this.cbOrderNumber.GetColumnValue("WORK_ORDER_KEY")); this._model.PartKey = Convert.ToString(this.cbOrderNumber.GetColumnValue("PART_KEY")); this._model.PartNumber = Convert.ToString(this.cbOrderNumber.GetColumnValue("PART_NUMBER")); this._model.Count = int.Parse(string.IsNullOrEmpty(this.teCount.Text) ? "0" : this.teCount.Text); this._model.CreateTypeCode = Convert.ToString(this.lueCreateType.EditValue); this._model.CreateTypeName = Convert.ToString(this.lueCreateType.Text); this._model.ShiftName = Convert.ToString(this.cbShiftName.EditValue); this._model.UserName = this.txtUserId.Text; if (string.IsNullOrEmpty(this._model.RoomKey)) { MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotDispatch.Msg004}"), MESSAGEBOX_CAPTION);//车间名称不能为空 this.cbFactoryRoom.Select(); return; } if (string.IsNullOrEmpty(this._model.OperationName)) { MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotDispatch.Msg005}"), MESSAGEBOX_CAPTION);//工序不能为空 this.cbOperation.Select(); return; } if (string.IsNullOrEmpty(this._model.ReceiveItemNo)) { MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotCreate.Msg001}"), MESSAGEBOX_CAPTION);//领料项目号不能为空 //MessageService.ShowMessage("领料项目号不能为空。", "提示"); this.lueReceiveItemNo.Select(); return; } if (string.IsNullOrEmpty(this._model.OrderNo)) { MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.SAP.Msg001}"), MESSAGEBOX_CAPTION);//工单号不能为空 this.lueReceiveItemNo.Select(); return; } if (this._model.Count == 0) { MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotCreate.Msg002}"), MESSAGEBOX_CAPTION);//投批数量不能为0 //MessageService.ShowMessage("投批数量不能为0。", "提示"); this.teCount.Select(); return; } if (string.IsNullOrEmpty(this._model.CreateTypeCode)) { MessageService.ShowMessage(StringParser.Parse("${res:FanHai.Hemera.Addins.WIP.LotCreate.Msg003}"), MESSAGEBOX_CAPTION);//创建类别不能为空 //MessageService.ShowMessage("创建类别不能为空。", "提示"); this.lueCreateType.Select(); return; } WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.CloseWindow(false); //创建新的视图并显示 LotCreateDetailViewContent view = new LotCreateDetailViewContent(this._model, this._isBatch); WorkbenchSingleton.Workbench.ShowView(view); }