127 lines
3.9 KiB
C#
127 lines
3.9 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using System.Diagnostics;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
using WMS.Attirubte;
|
|||
|
|
|
|||
|
|
using System.Data;
|
|||
|
|
using WMS.Model.Base;
|
|||
|
|
using WMS.Common;
|
|||
|
|
using WMS.Business;
|
|||
|
|
using WMS.Business.Base;
|
|||
|
|
|
|||
|
|
namespace WMS.Ctrl
|
|||
|
|
{
|
|||
|
|
public enum DateType
|
|||
|
|
{
|
|||
|
|
系统配置备注 = 0,
|
|||
|
|
基础资料备注 = 1,
|
|||
|
|
入库备注 = 2,
|
|||
|
|
库存备注 = 3,
|
|||
|
|
出库备注 = 4,
|
|||
|
|
上架策略备注 = 5,
|
|||
|
|
收货备注 = 6,
|
|||
|
|
客户备注 = 7,
|
|||
|
|
客户分类备注 = 8,
|
|||
|
|
库存调整备注 = 9,
|
|||
|
|
派工备注 = 10,
|
|||
|
|
排班备注 = 11,
|
|||
|
|
}
|
|||
|
|
public partial class NoteData : ComboBox
|
|||
|
|
{
|
|||
|
|
public NoteData()
|
|||
|
|
{
|
|||
|
|
// InitializeComponent();
|
|||
|
|
this.DisplayMember = "CONTENT";
|
|||
|
|
this.ValueMember = "CONTENT";
|
|||
|
|
this.Leave += new System.EventHandler(this.NoteData_Leave);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
DateType NoteType = DateType.系统配置备注;
|
|||
|
|
string type = string.Empty;
|
|||
|
|
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|||
|
|
//[Browsable(true)]
|
|||
|
|
[Description("备注类型")]
|
|||
|
|
[EditorBrowsable(EditorBrowsableState.Always)]
|
|||
|
|
[Localizable(true)]
|
|||
|
|
[Browsable(true)]
|
|||
|
|
public DateType NoteTypes
|
|||
|
|
{
|
|||
|
|
get { return NoteType; }
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
NoteType = value;
|
|||
|
|
|
|||
|
|
type = NoteType.ToString();
|
|||
|
|
|
|||
|
|
LoadData();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void LoadData()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
|
|||
|
|
// this.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
|
|||
|
|
|
|||
|
|
// Properties.Items.Clear();
|
|||
|
|
|
|||
|
|
string err = "";
|
|||
|
|
BaseRemarkDictionaryModel model = new BaseRemarkDictionaryModel();
|
|||
|
|
|
|||
|
|
model.REMARK_TYPE = type;
|
|||
|
|
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
List<BaseRemarkDictionaryModel> modelList = IBussFactory<BussBaseRemarkDictionary>.Instance().GetRemarkDictionaryList(model);
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (modelList != null)
|
|||
|
|
{
|
|||
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject<DataTable>(Newtonsoft.Json.JsonConvert.SerializeObject(modelList));
|
|||
|
|
|
|||
|
|
this.DataSource = dt;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
this.DataSource = null;
|
|||
|
|
// LogWriteText.WriteLog("控件错误:"+ex.Message.ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void NoteData_Leave(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (!string.IsNullOrEmpty(this.Text))
|
|||
|
|
{
|
|||
|
|
string err = "";
|
|||
|
|
BaseRemarkDictionaryModel model = new BaseRemarkDictionaryModel() { CONTENT = this.Text, REMARK_TYPE = NoteType.ToString() };
|
|||
|
|
List<BaseRemarkDictionaryModel> modelList = IBussFactory<BussBaseRemarkDictionary>.Instance().GetRemarkDictionaryList(model);
|
|||
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject<DataTable>(Newtonsoft.Json.JsonConvert.SerializeObject(modelList));
|
|||
|
|
if (dt.Rows.Count == 0)
|
|||
|
|
{
|
|||
|
|
model.ID = Guid.NewGuid().ToString();
|
|||
|
|
err = "";
|
|||
|
|
modelList = IBussFactory<BussBaseRemarkDictionary>.Instance().GetRemarkDictionaryList(model);
|
|||
|
|
if (modelList == null)
|
|||
|
|
{
|
|||
|
|
SystemCommon.ShowErrorMessageBox("添加备注信息失败!");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
LoadData();
|
|||
|
|
this.SelectedValue = model.CONTENT;
|
|||
|
|
// this.RefreshEditValue();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|