| | |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEA_ISystemService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Basic; |
| | | |
| | | namespace WIDESEA_SystemService |
| | | { |
| | |
| | | { |
| | | switch (key) |
| | | { |
| | | default: |
| | | return result; |
| | | case "warehouses": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | List<Dt_WarehouseArea> warehouses = BaseDal.Db.Queryable<Dt_WarehouseArea>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in warehouses) |
| | | { |
| | | data.Add(new { key = item.Code, value = item.Name }); |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "locationTypes": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | List<Dt_LocationType> warehouses = BaseDal.Db.Queryable<Dt_LocationType>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in warehouses) |
| | | { |
| | | data.Add(new { key = item.LocationType, value = item.LocationTypeDesc }); |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "stockStatusEmun": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(StockStatusEmun); |
| | | List<int> enums = Enum.GetValues(typeof(StockStatusEmun)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(StockStatusEmun).GetField(((StockStatusEmun)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return null; |