// using System.Text.RegularExpressions; static bool AllNumeric(string inputString) { return Regex.IsMatch(inputString, @"^\d+$"); } public string GetImage(object item) { if (item != null) { int index = Convert.ToInt32(Convert.ToString(item)); var missing = MissingItems.FirstOrDefault(x => x.Index == index); if ("accordionHeaderSelected".Equals(AccordianControl.Panes[index].HeaderCssClass)) { if (null == missing) { return("../assets/images/checked.png"); } else { return("../assets/images/unchecked.png"); } } else { if (null == missing) { return("../assets/images/checked.png"); } else { return("../assets/images/unchecked.png"); } } } return(""); }
public void RePopulate() { MissingBlocks.Clear(); MissingItems.Clear(); NotMissingBlocks.Clear(); NotMissingItems.Clear(); for (int i = 0; i < sapi.World.Blocks.Count; i++) { if (sapi.World.Blocks[i].IsMissing) { MissingBlocks.Add(sapi.World.Blocks[i].Code); } else { NotMissingBlocks.Add(sapi.World.Blocks[i].Code); } } for (int i = 0; i < sapi.World.Items.Count; i++) { if (sapi.World.Items[i].IsMissing) { MissingItems.Add(sapi.World.Items[i].Code); } else { NotMissingItems.Add(sapi.World.Items[i].Code); } } }
internal void FromEntries(Entries es) { SetAllNull(); SLMissingItem mi; SLNumberItem ni; SLErrorItem ei; SLStringItem si; using (var oxr = OpenXmlReader.Create(es)) { while (oxr.Read()) { if (oxr.ElementType == typeof(MissingItem)) { mi = new SLMissingItem(); mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement()); Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Missing, MissingItems.Count)); MissingItems.Add(mi); } else if (oxr.ElementType == typeof(NumberItem)) { ni = new SLNumberItem(); ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement()); Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Number, NumberItems.Count)); NumberItems.Add(ni); } else if (oxr.ElementType == typeof(ErrorItem)) { ei = new SLErrorItem(); ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement()); Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.Error, ErrorItems.Count)); ErrorItems.Add(ei); } else if (oxr.ElementType == typeof(StringItem)) { si = new SLStringItem(); si.FromStringItem((StringItem)oxr.LoadCurrentElement()); Items.Add(new SLEntriesItemsTypeIndexPair(SLEntriesItemsType.String, StringItems.Count)); StringItems.Add(si); } } } }
public List <MissingItems> getMissingItems() { DBAccess db1; List <string> storeNames = new List <string>() { "HP", "MH", "WG", "HC" }; //get all the autosort info associated with the qcs items for the day DashQueries db = new DashQueries(); List <qcsReportInfo> AutoSortInfo = db.getAutoInfo(); List <MissingItems> items = new List <MissingItems>(); foreach (qcsReportInfo info in AutoSortInfo) { db1 = new DBAccess(info.storeid); Customer c = db1.GetCustomer(info.CustomerID); MissingItems m = new MissingItems() { CustomerName = c.FirstName + " " + c.LastName, description = info.Description, store = storeNames[info.storeid - 1], qcsType = info.qcsType, TimeStampIn = info.TimeStampIn, rfid = info.rfid, HeatSeal = info.HeatSeal }; if (m.store == "MH" && !m.rfid.StartsWith(" ")) { m.store = "R"; } items.Add(m); } items = items.OrderBy(i => i.store).ThenBy(i => i.qcsType).ThenBy(i => i.CustomerName).ToList(); return(items); }
internal void FromGroupItems(GroupItems gis) { SetAllNull(); SLMissingItem mi; SLNumberItem ni; SLBooleanItem bi; SLErrorItem ei; SLStringItem si; SLDateTimeItem dti; using (var oxr = OpenXmlReader.Create(gis)) { while (oxr.Read()) { if (oxr.ElementType == typeof(MissingItem)) { mi = new SLMissingItem(); mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Missing, MissingItems.Count)); MissingItems.Add(mi); } else if (oxr.ElementType == typeof(NumberItem)) { ni = new SLNumberItem(); ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Number, NumberItems.Count)); NumberItems.Add(ni); } else if (oxr.ElementType == typeof(BooleanItem)) { bi = new SLBooleanItem(); bi.FromBooleanItem((BooleanItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Boolean, BooleanItems.Count)); BooleanItems.Add(bi); } else if (oxr.ElementType == typeof(ErrorItem)) { ei = new SLErrorItem(); ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Error, ErrorItems.Count)); ErrorItems.Add(ei); } else if (oxr.ElementType == typeof(StringItem)) { si = new SLStringItem(); si.FromStringItem((StringItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.String, StringItems.Count)); StringItems.Add(si); } else if (oxr.ElementType == typeof(DateTimeItem)) { dti = new SLDateTimeItem(); dti.FromDateTimeItem((DateTimeItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.DateTime, DateTimeItems.Count)); DateTimeItems.Add(dti); } } } }
internal void FromSharedItems(SharedItems sis) { SetAllNull(); if (sis.ContainsSemiMixedTypes != null) { ContainsSemiMixedTypes = sis.ContainsSemiMixedTypes.Value; } if (sis.ContainsNonDate != null) { ContainsNonDate = sis.ContainsNonDate.Value; } if (sis.ContainsDate != null) { ContainsDate = sis.ContainsDate.Value; } if (sis.ContainsString != null) { ContainsString = sis.ContainsString.Value; } if (sis.ContainsBlank != null) { ContainsBlank = sis.ContainsBlank.Value; } if (sis.ContainsMixedTypes != null) { ContainsMixedTypes = sis.ContainsMixedTypes.Value; } if (sis.ContainsNumber != null) { ContainsNumber = sis.ContainsNumber.Value; } if (sis.ContainsInteger != null) { ContainsInteger = sis.ContainsInteger.Value; } if (sis.MinValue != null) { MinValue = sis.MinValue.Value; } if (sis.MaxValue != null) { MaxValue = sis.MaxValue.Value; } if (sis.MinDate != null) { MinDate = sis.MinDate.Value; } if (sis.MaxDate != null) { MaxDate = sis.MaxDate.Value; } //count if (sis.LongText != null) { LongText = sis.LongText.Value; } SLMissingItem mi; SLNumberItem ni; SLBooleanItem bi; SLErrorItem ei; SLStringItem si; SLDateTimeItem dti; using (var oxr = OpenXmlReader.Create(sis)) { while (oxr.Read()) { if (oxr.ElementType == typeof(MissingItem)) { mi = new SLMissingItem(); mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Missing, MissingItems.Count)); MissingItems.Add(mi); } else if (oxr.ElementType == typeof(NumberItem)) { ni = new SLNumberItem(); ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Number, NumberItems.Count)); NumberItems.Add(ni); } else if (oxr.ElementType == typeof(BooleanItem)) { bi = new SLBooleanItem(); bi.FromBooleanItem((BooleanItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Boolean, BooleanItems.Count)); BooleanItems.Add(bi); } else if (oxr.ElementType == typeof(ErrorItem)) { ei = new SLErrorItem(); ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.Error, ErrorItems.Count)); ErrorItems.Add(ei); } else if (oxr.ElementType == typeof(StringItem)) { si = new SLStringItem(); si.FromStringItem((StringItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.String, StringItems.Count)); StringItems.Add(si); } else if (oxr.ElementType == typeof(DateTimeItem)) { dti = new SLDateTimeItem(); dti.FromDateTimeItem((DateTimeItem)oxr.LoadCurrentElement()); Items.Add(new SLSharedGroupItemsTypeIndexPair(SLSharedGroupItemsType.DateTime, DateTimeItems.Count)); DateTimeItems.Add(dti); } } } }
internal void FromPivotCacheRecord(PivotCacheRecord pcr) { SetAllNull(); SLMissingItem mi; SLNumberItem ni; SLBooleanItem bi; SLErrorItem ei; SLStringItem si; SLDateTimeItem dti; FieldItem fi; using (var oxr = OpenXmlReader.Create(pcr)) { while (oxr.Read()) { if (oxr.ElementType == typeof(MissingItem)) { mi = new SLMissingItem(); mi.FromMissingItem((MissingItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Missing, MissingItems.Count)); MissingItems.Add(mi); } else if (oxr.ElementType == typeof(NumberItem)) { ni = new SLNumberItem(); ni.FromNumberItem((NumberItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Number, NumberItems.Count)); NumberItems.Add(ni); } else if (oxr.ElementType == typeof(BooleanItem)) { bi = new SLBooleanItem(); bi.FromBooleanItem((BooleanItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Boolean, BooleanItems.Count)); BooleanItems.Add(bi); } else if (oxr.ElementType == typeof(ErrorItem)) { ei = new SLErrorItem(); ei.FromErrorItem((ErrorItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Error, ErrorItems.Count)); ErrorItems.Add(ei); } else if (oxr.ElementType == typeof(StringItem)) { si = new SLStringItem(); si.FromStringItem((StringItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.String, StringItems.Count)); StringItems.Add(si); } else if (oxr.ElementType == typeof(DateTimeItem)) { dti = new SLDateTimeItem(); dti.FromDateTimeItem((DateTimeItem)oxr.LoadCurrentElement()); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.DateTime, DateTimeItems.Count)); DateTimeItems.Add(dti); } else if (oxr.ElementType == typeof(FieldItem)) { fi = (FieldItem)oxr.LoadCurrentElement(); Items.Add(new SLPivotCacheRecordItemsTypeIndexPair(SLPivotCacheRecordItemsType.Field, FieldItems.Count)); FieldItems.Add(fi.Val.Value); } } } }