123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm
- {
- public partial class SetProcessAlertSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.SetProcessAlertSuperSmallForm
- {
- public SetProcessAlertSuperSmallForm()
- {
- }
- public bool IsSave = false;
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void SetProcessAlertSuperSmallForm_Load(object sender, EventArgs e)
- {
- DataTable tbl = new BLL.BLL_ErpSystemConfigure().GetSystemConfigureCustom("Sconfig_Code,Sconfig_Value", "Sconfig_Remark = 'Alert'").Tables[0];
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_OrderLater_NotShot")
- {
- this.txtA.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
- this.txtA.Tag = "ProcessMonitor_OrderLater_NotShot";
- }
- else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_photographedLater_NotEnd")
- {
- this.txtB.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
- this.txtB.Tag = "ProcessMonitor_photographedLater_NotEnd";
- }
- else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_photograpOKLater_NotSelect")
- {
- this.txtC.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
- this.txtC.Tag = "ProcessMonitor_photograpOKLater_NotSelect";
- }
- else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotLook")
- {
- this.txtD.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
- this.txtD.Tag = "ProcessMonitor_SelectOKLater_NotLook";
- }
- else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotQi")
- {
- this.txtE.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
- this.txtE.Tag = "ProcessMonitor_SelectOKLater_NotQi";
- }
- else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotTake")
- {
- this.txtF.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
- this.txtF.Tag = "ProcessMonitor_SelectOKLater_NotTake";
- }
- }
- }
- /// <summary>
- /// 保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnSave_Click(object sender, EventArgs e)
- {
- Hashtable htData = new Hashtable();
- htData["Sconfig_Code = '" + this.txtA.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtA.Text.Trim() + "'";
- htData["Sconfig_Code = '" + this.txtB.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtB.Text.Trim() + "'";
- htData["Sconfig_Code = '" + this.txtC.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtC.Text.Trim() + "'";
- htData["Sconfig_Code = '" + this.txtD.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtD.Text.Trim() + "'";
- htData["Sconfig_Code = '" + this.txtE.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtE.Text.Trim() + "'";
- htData["Sconfig_Code = '" + this.txtF.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtF.Text.Trim() + "'";
- if (htData.Count > 0)
- {
- if (new BLL.BLL_ErpSystemConfigure().UpdateToErpSystemConfigure(htData) > 0)
- { IsSave = true; MessageBoxCustom.Show("保存成功"); this.Close(); return; }
- }
- MessageBoxCustom.Show("保存出错");
- }
- /// <summary>
- /// 取消
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnCancel_Click(object sender, EventArgs e)
- { this.Close(); }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtF_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtE_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtD_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtC_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtB_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtA_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- }
- }
|