public void AddTrack(List <Track> lists) { RfDiction dic = new RfDiction { DicName = "轨道字典", DicCode = "TrackDic" }; RfDiction rfdic = new RfDiction { DicName = "站点字典", DicCode = "RfCodeDic" }; int order = 0, rfcodeorder = 0; foreach (Track item in lists) { dic.AddDtl(new RfDictionDtl() { DtlOrder = order, DtlValue = (int)item.id, DtlName = item.name }); AddTrackRfDicDtl(ref rfdic, ref rfcodeorder, item); order++; } AddDic(dic); AddDic(rfdic); }
public void AddEnum(Type type, string name, string code) { try { RfDiction dic = new RfDiction { DicName = name, DicCode = code }; Array array = type.GetEnumValues(); int order = 0; foreach (var value in array) { dic.AddDtl(new RfDictionDtl() { DtlOrder = order, DtlValue = (int)value, DtlName = value + "" }); order++; } AddDic(dic); }catch (Exception e) { Console.WriteLine(e.StackTrace); } }
private void AddRfCodeDtl(ref RfDiction dic, ref int order, string trackname, ushort rfcode) { if (rfcode > 0) { dic.AddDtl(new RfDictionDtl() { DtlName = trackname, DtlOrder = order, DtlValue = rfcode }); order++; } }
public void AddFerry(List <Device> lists) { RfDiction dic = new RfDiction { }; int order = 0; foreach (Device item in lists) { dic.AddDtl(new RfDictionDtl() { DtlOrder = order, DtlValue = (int)item.id, DtlName = item.name }); order++; } AddDic(dic); }
public void AddArea(List <Area> lists) { RfDiction dic = new RfDiction { DicName = "区域字典", DicCode = "AreaDic" }; int order = 0; foreach (Area item in lists) { dic.AddDtl(new RfDictionDtl() { DtlOrder = order, DtlValue = (int)item.id, DtlName = item.name }); order++; } AddDic(dic); }
public void AddCarrier(List <Device> lists) { RfDiction dic = new RfDiction { DicName = "运输车字典", DicCode = "CarrierDic" }; int order = 0; foreach (Device item in lists) { dic.AddDtl(new RfDictionDtl() { DtlOrder = order, DtlValue = (int)item.id, DtlName = item.name }); order++; } AddDic(dic); }
public void AddGood(List <Goods> lists) { RfDiction dic = new RfDiction { DicName = "规格字典", DicCode = "GoodDic" }; int order = 0; foreach (Goods item in lists) { dic.AddDtl(new RfDictionDtl() { DtlOrder = order, DtlValue = (int)item.id, DtlName = item.name }); order++; } AddDic(dic); }
public void AddDevice(List <Device> lists) { RfDiction devdic = new RfDiction { DicName = "设备字典", DicCode = "DeviceDic" }; RfDiction ferrydic = new RfDiction { DicName = "摆渡字典", DicCode = "FerryDic" }; RfDiction carrierdic = new RfDiction { DicName = "运输车字典", DicCode = "CarrierDic" }; RfDiction tilelifterdic = new RfDiction { DicName = "砖机字典", DicCode = "TileLifterDic" }; int order = 0, ferryorder = 0, tileoder = 0, carrierorder = 0; foreach (Device item in lists) { devdic.AddDtl(new RfDictionDtl() { DtlOrder = order, DtlValue = (int)item.id, DtlName = item.name }); order++; switch (item.Type) { case DeviceTypeE.砖机: case DeviceTypeE.砖机: tilelifterdic.AddDtl(new RfDictionDtl() { DtlOrder = tileoder, DtlValue = (int)item.id, DtlName = item.name }); tileoder++; break; case DeviceTypeE.摆渡: case DeviceTypeE.摆渡: ferrydic.AddDtl(new RfDictionDtl() { DtlOrder = ferryorder, DtlValue = (int)item.id, DtlName = item.name }); ferryorder++; break; case DeviceTypeE.运输车: carrierdic.AddDtl(new RfDictionDtl() { DtlOrder = carrierorder, DtlValue = (int)item.id, DtlName = item.name }); carrierorder++; break; } } AddDic(devdic); AddDic(tilelifterdic); AddDic(ferrydic); AddDic(carrierdic); }