|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using BPASmartClient.MorkCL.Server;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.MorkCL.HelpClass
- {
- public class FuncParHelpClass:FuncPar
- {
- private bool _IsUseComboBox;
- /// <summary>
- /// 根据参数名称,判断是否使用组合框。
- /// </summary>
- public bool IsUseComboBox
- {
- get { return _IsUseComboBox; }
- set { _IsUseComboBox = value; }
- }
-
-
- private ObservableCollection<object> _ComboBoxItemsSource;
-
- public ObservableCollection<object> ComboBoxItemsSource
- {
- get { return _ComboBoxItemsSource; }
- set { _ComboBoxItemsSource = value;}
- }
- /// <summary>
- /// 参数数据源。
- /// </summary>
- public static Dictionary<string, ObservableCollection<object>> ParOptions { get; } = new Dictionary<string, ObservableCollection<object>>()
- {
- //{"搅拌速度",new ObservableCollection<object>(){10,20,30,40,50 } },
- //{"加热档位",new ObservableCollection<object> {1,2,3,4,5,6,7,8} },
- {"调料名称",new ObservableCollection<object>( SqliteHelper.GetInstance.GetSeasoning()) },
- {"主料名称",new ObservableCollection<object>( SqliteHelper.GetInstance.GetIngredients()) },
- {"辅料名称",new ObservableCollection<object>( SqliteHelper.GetInstance.GetAccessories()) },
- //{"设置炒制位",new ObservableCollection<object> {1,2,3,4} },
-
- };
-
- public static ObservableCollection<object> GetParOptions(string paramName)
- {
- if (paramName is null)
- {
- throw new ArgumentNullException("paramName", "参数名称不可为空");
- }
-
- ObservableCollection<object> parOption;
-
- switch (paramName)
- {
- case "调料名称": parOption = new ObservableCollection<object>(SqliteHelper.GetInstance.GetSeasoning());
- break;
- case "主料名称":
- parOption = new ObservableCollection<object>(SqliteHelper.GetInstance.GetIngredients());
- break;
- case "辅料名称":
- parOption = new ObservableCollection<object>(SqliteHelper.GetInstance.GetAccessories());
- break;
- default:
- parOption = new();
- break;
- }
- return parOption;
- }
- }
- }
|