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.
125 lines
3.4 KiB
125 lines
3.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Shapes;
|
|
using System.Data;
|
|
|
|
namespace SiaSun.LMS.WPFClient.Dialog
|
|
{
|
|
/// <summary>
|
|
/// WorkMode.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class SYSMode : Window
|
|
{
|
|
|
|
string inventory_code = string.Empty;
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
public SYSMode()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 加载窗体
|
|
/// </summary>
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
DataTable dtMode = MainApp._I_BaseService.GetList(string.Format("SELECT * FROM SYS_ITEM_LIST WHERE ITEM_ID=96"));
|
|
|
|
#region 模式设置
|
|
|
|
string WorkMode = dtMode.Rows[0]["ITEM_LIST_CODE"].ToString();
|
|
foreach (UIElement element in wpWorkMode.Children)
|
|
{
|
|
if (!(element is RadioButton))
|
|
continue;
|
|
|
|
if ((element as RadioButton).Tag.ToString() == WorkMode)
|
|
{
|
|
(element as RadioButton).IsChecked = true;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
/// <summary>
|
|
/// 按钮事件
|
|
/// </summary>
|
|
private void WrapPanel_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
Button btn = e.OriginalSource as Button;
|
|
if (btn != null)
|
|
{
|
|
switch (btn.Name)
|
|
{
|
|
case "btnOK":
|
|
this.Save(btn);
|
|
break;
|
|
case "btnCancel":
|
|
this.Close();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// </summary>
|
|
private void Save(object sender)
|
|
{
|
|
string sResult = string.Empty;
|
|
bool bResult = true;
|
|
|
|
try
|
|
{
|
|
|
|
string WorkMode = string.Empty;
|
|
if (this.rbtAuto.IsChecked == true)
|
|
{
|
|
WorkMode = this.rbtAuto.Tag.ToString();
|
|
}
|
|
else if (this.rbtManual.IsChecked == true)
|
|
{
|
|
WorkMode = this.rbtManual.Tag.ToString();
|
|
}
|
|
else
|
|
{
|
|
bResult = false;
|
|
sResult = string.Format("请选择一种模式");
|
|
return;
|
|
}
|
|
|
|
string SQL = string.Format("update sys_item_list set ITEM_LIST_CODE='{0}' where ITEM_ID=96", WorkMode);
|
|
MainApp._I_BaseService.ExecuteNonQuery_ReturnVoid(SQL);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
bResult = false;
|
|
sResult = ex.Message;
|
|
}
|
|
finally
|
|
{
|
|
if (!bResult)
|
|
{
|
|
MainApp._MessageDialog.ShowResult(bResult, sResult);
|
|
}
|
|
else
|
|
{
|
|
MainApp._MessageDialog.ShowResult(bResult, sResult);
|
|
this.DialogResult = bResult;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|