MyMCCombobox 添加

wangsr
nodyang 1 year ago
parent 25a8cad456
commit 492122310d

@ -15,11 +15,11 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
/// 获取干混机物料
/// </summary>
/// <returns></returns>
public static List<MyNameValue> GetDryerMaterrial()
public static List<MyMCCombobox> GetDryerMaterrial()
{
var list = GetStockMaterrial(1);
list.RemoveAll(x => x.Id == 5);
list.RemoveAll(x => x.Id == 6);
list.RemoveAll(x => x.CmbValue == 5);
list.RemoveAll(x => x.CmbValue == 6);
return list;
}
@ -27,10 +27,10 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
/// 获取糊化机物料
/// </summary>
/// <returns></returns>
public static List<MyNameValue> GetSiloMaterrial()
public static List<MyMCCombobox> GetSiloMaterrial()
{
var list1 = GetStockMaterrial(1);
list1 = list1.Where(x => x.Id == 5 || x.Id == 6).ToList();
list1 = list1.Where(x => x.CmbValue == 5 || x.CmbValue == 6).ToList();
return list1;
}
@ -50,16 +50,16 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
private static List<MyNameValue> GetStockMaterrial(int mtypId)
private static List<MyMCCombobox> GetStockMaterrial(int mtypId)
{
string sql = "select Id, Code, StockName, MTypeId, MTypeName, MId, MName, Remark from lj_stock_material";
var dataTable = DBHelp.GetTable(sql);
List<MyNameValue> ls = new List<MyNameValue>();
ls.Add(new MyNameValue()
List<MyMCCombobox> ls = new List<MyMCCombobox>();
ls.Add(new MyMCCombobox()
{
Id = -1,
Name = "请选择"
CmbValue = -1,
CmbDisplay = "请选择"
});
foreach (DataRow o in dataTable.Rows)
{
@ -68,10 +68,10 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
{
if (tableMTypeId == mtypId)
{
ls.Add(new MyNameValue()
ls.Add(new MyMCCombobox()
{
Id = (int)o["Id"],
Name = o["StockName"].ToString() + $"({o["MName"]})"
CmbValue = (int)o["Id"],
CmbDisplay = o["StockName"].ToString() + $"({o["MName"]})"
});
}
}

@ -13,6 +13,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Mesnac.Controls.Default;
using Button = System.Windows.Forms.Button;
namespace Mesnac.Action.ChemicalWeighing.AutoControl
{
@ -228,6 +230,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
private IBaseControl GetBaseControl(string name)
{
return McControls.First(x => x.Name == name) as IBaseControl;
}

@ -15,6 +15,16 @@ namespace Mesnac.Action.ChemicalWeighing.LjMaterial
public string Name { get; set; }
}
public class MyMCCombobox
{
public int CmbValue { get; set; }
public string CmbDisplay { get; set; }
}
public class MyNameValueStr
{
public string Id { get; set; }

Loading…
Cancel
Save