2021-06-05 14:17:30 +08:00
|
|
|
|
using CleanMachineHMI.forms;
|
|
|
|
|
|
using CleanMachineHMI.FrmUserControl;
|
|
|
|
|
|
using CleanMachineHMI.Utils;
|
2021-12-26 21:30:02 +08:00
|
|
|
|
using Krypton.Toolkit;
|
2021-06-05 14:17:30 +08:00
|
|
|
|
using LeadDataBaseUtility;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CleanMachineHMI.frmChild
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class frmEditSheetType : KryptonForm
|
|
|
|
|
|
{
|
|
|
|
|
|
public frmEditSheetType()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
_InfoLanguageTextList = this.GetInfoLanguageText(GlobalHelper.LanguageCode);
|
|
|
|
|
|
}
|
|
|
|
|
|
private DataTable _InfoLanguageTextList;
|
|
|
|
|
|
public string SheetTypeId { get; set; }
|
|
|
|
|
|
private void txt_GotFocus(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
KeyboardAutoPopUp.ShowInputPanel();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void txt_LostFocus(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
KeyboardAutoPopUp.HideInputPanel();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void InitControlEvent()
|
|
|
|
|
|
{
|
|
|
|
|
|
txtSheetTypeCode.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
txtSheetTypeCode.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
txtSheetTypeName.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
txtSheetTypeName.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void frmEditSheetType_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
InitControlEvent();
|
2022-03-18 19:06:26 +08:00
|
|
|
|
this.SetFormControlText();
|
2021-06-05 14:17:30 +08:00
|
|
|
|
string sql = $@"SELECT * FROM BAS_SHEET_TYPE WHERE SHEET_TYPE_ID = '{SheetTypeId}'";
|
|
|
|
|
|
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
|
|
|
|
|
|
if (dt != null && dt.Rows.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
txtSheetTypeCode.Text = dt.Rows[0]["SHEET_TYPE_CODE"].ToString();
|
|
|
|
|
|
txtSheetTypeCode.Enabled = false;
|
|
|
|
|
|
txtSheetTypeName.Text = dt.Rows[0]["SHEET_TYPE_NAME"].ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonPanel1.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
2022-03-18 19:06:26 +08:00
|
|
|
|
KryptonMessageBox.Show(this.GetInfoText("编辑板材数据界面加载异常", "LoadEditFrmExp") + $":【{ex.Message}】!");
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnAdd_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(txtSheetTypeName.Text))
|
|
|
|
|
|
{
|
|
|
|
|
|
//KryptonMessageBox.Show("请输入板材名称!");
|
2022-03-18 19:06:26 +08:00
|
|
|
|
KryptonMessageBox.Show(this.GetInfoText("请输入板材名称!", "EnterSheetTypeNameInfo"));
|
2021-06-05 14:17:30 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2021-12-31 16:27:14 +08:00
|
|
|
|
string sql = $@"update BAS_SHEET_TYPE set SHEET_TYPE_NAME = '{txtSheetTypeName.Text}',UPDATE_BY = '{GlobalHelper.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime') where SHEET_TYPE_ID = '{SheetTypeId}'";
|
2021-06-05 14:17:30 +08:00
|
|
|
|
int row = LeadDbHelperSQLite.ExecuteSql(sql);
|
|
|
|
|
|
if (row > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
//KryptonMessageBox.Show("修改板材数据成功!");
|
2022-03-18 19:06:26 +08:00
|
|
|
|
KryptonMessageBox.Show(this.GetInfoText("编辑板材数据成功!", "EditSuccessInfo"));
|
2021-06-05 14:17:30 +08:00
|
|
|
|
frmSheetType.RefreshFrmHost();
|
|
|
|
|
|
this.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
//KryptonMessageBox.Show("修改板材数据失败!");
|
2022-03-18 19:06:26 +08:00
|
|
|
|
KryptonMessageBox.Show(this.GetInfoText("编辑板材数据失败!", "EditFailInfo"));
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
2022-03-18 19:06:26 +08:00
|
|
|
|
KryptonMessageBox.Show(this.GetInfoText("编辑板材类型数据发生异常", "EditSheetTypeDataExp") + $":【{ex.Message}】!");
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void btnEdit_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|