private int Comparer_MH(MaskHistory x, MaskHistory y) { int cmp = DateTime.Compare(x.START_TIME.GetValueOrDefault(), y.START_TIME.GetValueOrDefault()); if (cmp == 0) { DateTime.Compare(x.END_TIME.GetValueOrDefault(), y.END_TIME.GetValueOrDefault()); } return(cmp); }
private void ImportData() { _datas.Clear(); _eaInfos.Clear(); _eaMatchInfos.Clear(); _eamMatchInfos.Clear(); _mhInfos.Clear(); ImportData_EA(); ImportData_EAM(); ImportData_MH(); var datas = _datas; var maInfos = ImportData_MA(); DateTime targetDate = this.TargetDate; foreach (var it in maInfos) { var item = it.Value.FirstOrDefault(); if (item == null) { continue; } if (IsNeedCheck_EA(item.ShopID, item.StepID)) { var list = GetMatchedList_EA(item); int count = list == null ? 0 : list.Count; item.Issue_EAM = count == 0; if (item.Issue_EAM == false) { var find = list.FirstOrDefault(t => t.Target.MASK_ID == item.MaskID && t.IsLoadable()); if (find == null) { item.Issue_EAM = true; } } } //EqpArrange LimitType = 'M' if (item.Issue_EAM == false) { var list = GetMatchedList_EAM(item.MaskID); if (list != null && list.Count > 0) { //check limit var notloadables = list.FirstOrDefault(t => t.IsLoadable() == false); if (notloadables != null) { item.Issue_EAM = true; } } } var mhlist = GetMatchedList_MH(item.MaskID, targetDate); MaskHistory last = mhlist == null ? null : mhlist.LastOrDefault(); if (last != null) { item.UsedLast = last; item.UsedCount = mhlist.GroupBy(t => t.LOT_ID).Count(); } datas.Add(item); } }