////////////////public CompSet(string _name, List<Component.Component> _comps, Supl _supl, Docs _doc, List<FP> _csFPs) ////////////////{ //////////////// this.name = _name; //////////////// this.Components = _comps; //////////////// this.Supplier = _supl; //////////////// this.doc = _doc; //////////////// this.csFPs = _csFPs; ////////////////} public CompSet(string _name, Supl _supl, Rule.Rule _rule) { name = _name; Supplier = _supl; doc = getCSdoc(Supplier, _name); csFPs = _rule.Parser(FP.type.CompSet, doc.LoadDescription); for (int i = doc.i0; i < doc.il; i++) { Comp comp = new Comp(doc, i, csFPs); Components.Add(comp); } }
public CompSet(string _name, Supl _supl, string LoadDescription = "", List <Comp> comps = null) { name = _name; Supplier = _supl; if (!string.IsNullOrEmpty(LoadDescription)) { csDP = new DP(LoadDescription); Components = comps; } else { doc = getCSdoc(Supplier, _name); csDP = new DP(doc.LoadDescription); for (int i = doc.i0; i < doc.il; i++) { Components.Add(new Comp(doc, i, csDP)); } } }
//-- get cs doc from TOC by cs_name and Supplier in TSmatch.xlsx/Rule private Docs getCSdoc(Supl supplier, string _name) { string docName = string.Empty; Docs toc = Docs.getDoc(); for (int i = toc.i0; i <= toc.il; i++) { string suplName = toc.Body.Strng(i, Decl.DOC_SUPPLIER); string csSheet = toc.Body.Strng(i, Decl.DOC_SHEET); if (suplName != Supplier.Name || csSheet != name) { continue; } docName = toc.Body.Strng(i, Decl.DOC_NAME); break; } if (string.IsNullOrEmpty(docName)) { throw new Exception("CompSet not found price list"); // 22.5.17 Msg.F("CompSet not found price list"); } return(Docs.getDoc(docName)); }