| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- 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 Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using Core.StlMes.Client.PlnSaleOrd.工序排产;
- namespace Core.StlMes.Client.PlnSaleOrd
- {
- public partial class FrmCL : FrmBase
- {
- /// <summary>
- /// 产线
- /// </summary>
- private string _plineCode;
- /// <summary>
- /// 工序
- /// </summary>
- private string _processCode;
- private string _jsonStr;
- private string _username;
- public FrmCL(string plineCode, string processCode, String jsonStr,string username,OpeBase ob)
- {
- //窗体居中
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- //取消窗体默认关闭按钮
- this.ControlBox = false;
- this.ob = ob;
- _plineCode = plineCode;
- _processCode = processCode;
- _jsonStr = jsonStr;
- _username = username;
- InitializeComponent();
- }
- private void FrmCL_Load(object sender, EventArgs e)
- {
- InitRepairType();
- InitPline();
- GetMaxTimeByPlineCode();
- comStyle.ValueMember = "承揽";
- }
- private void InitPline()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.BaseHelper.initPline", new object[] { _processCode, "", "" }, this.ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- comPline.DataSource = dt;
- comPline.ValueMember = "PLINE_CODE";
- comPline.DisplayMember = "PLINE_NAME";
- comPline.Value = _plineCode;
- }
- }
- private void InitRepairType()
- {
- DataTable dt = new DataTable();
- dt.Columns.Add("RepairType");
- DataRow dr1 = dt.NewRow();
- dr1["RepairType"] = "承揽";
- dt.Rows.Add(dr1);
- comStyle.DataSource = dt;
- comStyle.DisplayMember = "RepairType";
- comStyle.ValueMember = "RepairType";
- }
- private void GetMaxTimeByPlineCode()
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.getMaxTime", new object[] { _plineCode, _processCode }, this.ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- timeBeign.Value = dt.Rows[0]["PLAN_TIME_E"].ToString();
- timeEnd.Value = dt.Rows[0]["PLAN_TIME_E"].ToString();
- }
- }
- private void buttonAdd_Click(object sender, EventArgs e)
- {
- string plineCode = comPline.Value == null ? "" : comPline.Value.ToString();
- string plineName = comPline.Text;
- if (plineCode.Equals(""))
- {
- MessageUtil.ShowWarning("请选择承揽产线!");
- return;
- }
- if (plineCode.Equals(_plineCode))
- {
- MessageUtil.ShowWarning("不能承揽给本产线!");
- return;
- }
- if (comStyle.Value == null)
- {
- MessageUtil.ShowTips("请选择检修类型!");
- return;
- }
- string repairType = comStyle.Value.ToString();
- if (txtTime.Value == null)
- {
- MessageUtil.ShowTips("请输入承揽耗时!");
- return;
- }
- string useHour = txtTime.Value.ToString().Trim();
- string memo = txtMemo.Text.Trim();
- if (memo.Equals(""))
- {
- MessageUtil.ShowTips("请输入备注!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否新增承揽?") == DialogResult.No)
- {
- return;
- }
- string[] param = PlanHelper.SetData("com.steering.pss.plnsaleord.processOrder.base.ProducHelper.addCL", new object[] { _jsonStr, plineCode,
- plineName, repairType, useHour,
- _username, memo, _processCode }, ob);
- if (param == null) { MessageUtil.ShowTips("服务端处理失败!"); return; }
- else
- {
- MessageUtil.ShowTips(param[1]);
- if ((bool.Parse(param[0])))
- {
- }
- }
- }
- private void buttonCancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
-
- }
- }
|