156 lines
4.3 KiB
C#
156 lines
4.3 KiB
C#
|
|
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 WMS.Frm.Base;
|
|||
|
|
using WMS.Base.WebService;
|
|||
|
|
using WMS.Common;
|
|||
|
|
using WMS.Model.SystemManage;
|
|||
|
|
|
|||
|
|
namespace WMS.FrmBaseData
|
|||
|
|
{
|
|||
|
|
public partial class FrmUpStrategy : FormBase
|
|||
|
|
{
|
|||
|
|
#region 变量
|
|||
|
|
static string strID = "";
|
|||
|
|
/// <summary>
|
|||
|
|
/// 字典信息
|
|||
|
|
/// </summary>
|
|||
|
|
List<DictionaryTabModel> listDictionaryTabModel = new List<DictionaryTabModel>();
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 构造函数
|
|||
|
|
public FrmUpStrategy()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 窗体加载
|
|||
|
|
private void FrmUpStrategy_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
string errText = string.Empty;
|
|||
|
|
string strDictionaryTabModel = WebLockConfig.Instance.DictionaryTab.GetDictionaryTab("strategy_status", ref errText);
|
|||
|
|
listDictionaryTabModel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<DictionaryTabModel>>(strDictionaryTabModel);
|
|||
|
|
dictionaryTabModelBindingSource.DataSource = listDictionaryTabModel;
|
|||
|
|
|
|||
|
|
DataBind();
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 绑定数据
|
|||
|
|
/// <summary>
|
|||
|
|
/// 绑定数据
|
|||
|
|
/// </summary>
|
|||
|
|
private void DataBind()
|
|||
|
|
{
|
|||
|
|
//string strName = txtName.Text;
|
|||
|
|
//string strState = "";
|
|||
|
|
//if (LueState.EditValue != null)
|
|||
|
|
//{
|
|||
|
|
// strState = LueState.EditValue.ToString();
|
|||
|
|
//}
|
|||
|
|
//string errText = string.Empty;
|
|||
|
|
//string strDataTable = WebLockConfig.Instance.WebUpStrategy.GetUpStrategy(strName, strState, "", ref errText);
|
|||
|
|
//DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject<DataTable>(strDataTable);
|
|||
|
|
//gridControlCustom1.DataSource = dt;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 按钮事件
|
|||
|
|
/// <summary>
|
|||
|
|
/// 添加
|
|||
|
|
/// </summary>
|
|||
|
|
public void add()
|
|||
|
|
{
|
|||
|
|
FrmUpStrategyDet.Instance(0).ShowDialog();
|
|||
|
|
DataBind();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询
|
|||
|
|
/// </summary>
|
|||
|
|
public void seach()
|
|||
|
|
{
|
|||
|
|
DataBind();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 编辑
|
|||
|
|
/// </summary>
|
|||
|
|
public void edit()
|
|||
|
|
{
|
|||
|
|
if (GetDataOne())
|
|||
|
|
{
|
|||
|
|
FrmUpStrategyDet.StrategyID = strID;
|
|||
|
|
FrmUpStrategyDet.Instance(1).ShowDialog();
|
|||
|
|
DataBind();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除
|
|||
|
|
/// </summary>
|
|||
|
|
public void del()
|
|||
|
|
{
|
|||
|
|
if (GetDataOne())
|
|||
|
|
{
|
|||
|
|
if (SystemCommon.ShowMessageBoxResult("是否确定删除此信息!") == DialogResult.Yes)
|
|||
|
|
{
|
|||
|
|
string errText = string.Empty;
|
|||
|
|
WebLockConfig.Instance.WebUpStrategy.DeleteUpStrategy(strID, ref errText);
|
|||
|
|
if (errText != "")
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowErrorMessageBox(errText);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowInfoMessageBox("操作成功!");
|
|||
|
|
DataBind();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 清空
|
|||
|
|
/// </summary>
|
|||
|
|
public void clrear()
|
|||
|
|
{
|
|||
|
|
//txtName.Text = "";
|
|||
|
|
//LueState.EditValue = null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 判断是否中一条信息
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
private bool GetDataOne()
|
|||
|
|
{
|
|||
|
|
bool bflag = true;
|
|||
|
|
if (strID == "")
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowErrorMessageBox("请选择一条上架策略信息!");
|
|||
|
|
bflag = false;
|
|||
|
|
}
|
|||
|
|
return bflag;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 选择行事件
|
|||
|
|
private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (e.FocusedRowHandle < 0)
|
|||
|
|
return;
|
|||
|
|
|
|||
|
|
strID = gridView1.GetRowCellValue(e.FocusedRowHandle, "UPSTRATEGY_ID").ToString();
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
}
|