ModblsPositionXML.cs
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.Common
{
public class ModblsPositionXML : XmlData
{
public int num { get; set; }
public int type { get; set; }
public int position { get; set; }
/// <summary>
/// 获取电缸移动到的位置
/// </summary>
/// <param name="num">层数,1000表示料口的位置</param>
/// <param name="type">1=低位置,2=高位置</param>
/// <returns></returns>
public static ModblsPositionXML getByNumAndType(int num, int type)
{
Dictionary<int, ModblsPositionXML> allDic = XMLCache<ModblsPositionXML>.getAllData(typeof(ModblsPositionXML));
foreach (ModblsPositionXML mo in allDic.Values)
{
if (mo.num == num && mo.type == type)
{
return mo;
}
}
return null;
}
public static List<ModblsPositionXML> getSortList()
{
List<ModblsPositionXML> list = new List<ModblsPositionXML>();
Dictionary<int, ModblsPositionXML> allDic = XMLCache<ModblsPositionXML>.getAllData(typeof(ModblsPositionXML));
list = (from m in allDic.Values.ToList<ModblsPositionXML>() orderby m.num ascending, m.type ascending, m.id descending select m).ToList<ModblsPositionXML>();
return list;
}
}
}