You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
132 lines
5.2 KiB
132 lines
5.2 KiB
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 Model;
|
|
|
|
namespace QMAPP.WinForm.Forms.TianJin
|
|
{
|
|
public partial class TJfrmLineSetting : Form
|
|
{
|
|
/// <summary>
|
|
/// 工位终端:设置生产线,设置完成的生产线保存在APP.CONFIG中的FlashProCode。
|
|
/// 创建时间:2013-03-30
|
|
/// 创 建 人:Sun G.Q.
|
|
/// </summary>
|
|
public TJfrmLineSetting()
|
|
{
|
|
InitializeComponent();
|
|
//理想是生产线从数据库表中读取,这里,写死它。
|
|
IList<EProCodeInfo> proCodes = new List<EProCodeInfo>();
|
|
// EProCodeInfo epci = new EProCodeInfo();
|
|
//epci._Code = "02";
|
|
// epci._Name = "NF单线";
|
|
|
|
// proCodes.Add(epci);
|
|
// epci = new EProCodeInfo();
|
|
//epci._Code = "01";
|
|
//epci._Name = "NF&NCS混线";
|
|
//proCodes.Add(epci);
|
|
|
|
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
|
|
DataTable tblCodes = agent.InvokeServiceFunction<DataTable>(QMAPP.ServicesAgent.FrmPlaceManage.FrmPlaceBLL_GetWORKCENTERCODE.ToString());
|
|
|
|
for (var i = 0; i < tblCodes.Rows.Count; i++)
|
|
{
|
|
EProCodeInfo epci = new EProCodeInfo();
|
|
epci._Name = tblCodes.Rows[i][1].ToString();
|
|
epci._Code = tblCodes.Rows[i][0].ToString();
|
|
proCodes.Add(epci);
|
|
|
|
}
|
|
cmbProCode.DataSource = proCodes;
|
|
cmbProCode.DisplayMember = "_Name";
|
|
cmbProCode.ValueMember = "_Code";
|
|
//String vv = QM.Config.CustomConfig.GetItem("FlashProCode");
|
|
//cmbProCode.SelectedValue = QM.Config.CustomConfig.GetItem("PlantNameConfig");
|
|
|
|
//String vv = QMAPP.WinForm.Common.LocalSetting.Settings["FlashProCode"];
|
|
cmbProCode.SelectedValue = QMAPP.WinForm.Common.LocalSetting.Settings["PlantNameConfig",""];
|
|
|
|
cbPrintEnable.Checked = string.Equals(QMAPP.WinForm.Common.LocalSetting.Settings["PrintDisable", "1"], "0");
|
|
cbPastNoConfirmEnable.Checked = string.Equals(QMAPP.WinForm.Common.LocalSetting.Settings["PastNOConfirmEnable", "0"], "1");
|
|
|
|
cbAlertConfirmEnable.Checked = string.Equals(QMAPP.WinForm.Common.LocalSetting.Settings["AlertConfirmEnable", "0"], "1");
|
|
|
|
txtStorageTimeLimit.Text = QMAPP.WinForm.Common.LocalSetting.Settings["StorageTimeLimit", "24"];
|
|
|
|
|
|
}
|
|
|
|
private void btnSave_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
//if (txPwd.Text.Trim() == String.Empty)
|
|
//{
|
|
// MessageBox.Show("请输入密码。");
|
|
// return;
|
|
//}
|
|
//String pwd = txPwd.Text.Trim();
|
|
|
|
|
|
//if ("#7788d" == pwd)
|
|
//{
|
|
|
|
// QM.Config.CustomConfig.SetItem("FlashProCode", cmbProCode.SelectedValue.ToString());
|
|
// //MessageBox.Show("生产线设置成功,请重新登录系统。");
|
|
try
|
|
{
|
|
TJFrmPlace fplace = (TJFrmPlace)this.Owner;
|
|
//fplace.WORKCENTER_CODE = cmbProCode.SelectedValue.ToString();
|
|
//QM.Config.CustomConfig.SetItem("PlantNameConfig", fplace.WORKCENTER_CODE);
|
|
//QMAPP.WinForm.Common.LocalSetting.Settings["PlantNameConfig"] = fplace.WORKCENTER_CODE;
|
|
|
|
QMAPP.WinForm.Common.LocalSetting.Settings["PrintDisable"] = cbPrintEnable.Checked ? "0" : "1";
|
|
QMAPP.WinForm.Common.LocalSetting.Settings["PastNOConfirmEnable"] = cbPastNoConfirmEnable.Checked ? "1" : "0";
|
|
|
|
QMAPP.WinForm.Common.LocalSetting.Settings["AlertConfirmEnable"] = cbAlertConfirmEnable.Checked ? "1" : "0";
|
|
|
|
var StorageTimeLimit = 0d;
|
|
if (double.TryParse(txtStorageTimeLimit.Text.Trim(), out StorageTimeLimit))
|
|
{
|
|
QMAPP.WinForm.Common.LocalSetting.Settings["StorageTimeLimit"] = txtStorageTimeLimit.Text.Trim();
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("产品下线时间限制未能保存,请输入数字!");
|
|
txtStorageTimeLimit.SelectAll();
|
|
txtStorageTimeLimit.Focus();
|
|
return;
|
|
}
|
|
|
|
|
|
//fplace.pFisType = fplace.WORKCENTER_CODE.Substring(fplace.WORKCENTER_CODE.Length - 2, 2);
|
|
|
|
fplace.GetInitData();
|
|
this.Close();
|
|
// //foreach (Form frm in this.MdiChildren)
|
|
// //{
|
|
// // frm.Close();
|
|
// //}
|
|
// //if (this.MdiChildren.Length == 0)
|
|
// //{
|
|
// // Application.Restart();
|
|
// //}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
//}
|
|
//else
|
|
//{
|
|
// MessageBox.Show("密码错误。");
|
|
//}
|
|
}
|
|
}
|
|
}
|
|
|