예제 #1
0
 // 27/3/2017 пока - for unit test purpases only
 public Rule(string str, CmpSet cs)
 {
     text     = str;
     synonyms = RuleSynParse(str);
     ruleDP   = new DP(str);
     CompSet  = cs;
 }
예제 #2
0
 // 27/3/2017 пока - for unit test purpases only
 public Rule(string str, Supl supplier = null, CmpSet cs = null)
 {
     text     = str;
     synonyms = RuleSynParse(str);
     ruleDP   = new DP(str);
     CompSet  = cs;
     Supplier = supplier;
 }
예제 #3
0
 /// <summary>
 /// constructor Component(doc, i, List<FP>cs_fps, List<FP>rule_fps) - get Component from price-list in doc line i
 /// </summary>
 /// <param name="doc">document - price-list</param>
 /// <param name="i">line number in doc</param>
 /// <param name="csDP">DP - parsed LoadDescroption from CompSet</param>
 public Component(Docs doc, int i, DP csDP)
 {
     compDP = new DP("");
     foreach (SType sec in csDP.dpar.Keys)
     {
         var II  = csDP.Col(SType.UNIT_Weight);
         int col = csDP.Col(sec);
         if (col > 0 && col <= doc.Body.iEOC())
         {
             compDP.Ad(sec, doc.Body.Strng(i, col));
         }
     }
 }
예제 #4
0
        public double RuleRedundencyPerCent = 0.0;  //коэффициент избыточности, требуемый запас по данному материалу/профилю/Правилу

        public Rule(Docs doc, int i)
        {
            name     = (string)doc.Body[i, Decl.RULE_NAME];
            type     = (string)doc.Body[i, Decl.RULE_TYPE];
            text     = Lib.ToLat((string)doc.Body[i, Decl.RULE_RULE]);
            synonyms = RuleSynParse(text);
            ruleDP   = new DP(text); // template for identification
            string csName   = (string)doc.Body[i, Decl.RULE_COMPSETNAME];
            string suplName = (string)doc.Body[i, Decl.RULE_SUPPLIERNAME];

            Supplier = new Suppliers.Supplier(suplName);
            CompSet  = new CmpSet(csName, Supplier);
        }
예제 #5
0
        public Comp Im_Comp(string mat, string descr, string price)
        {
            string str = "";

            str += "M:" + mat + ";";
            str += "Descr:" + descr + ";";
            //Profile = копия из Description только для отладки!!
            str += "Profile:" + descr + ";";
            str += "Price:" + price + ";";
            DP   dp     = new DP(str);
            Comp compDP = new Comp(dp, null);

            return(compDP);
        }
예제 #6
0
 public Rule(Docs doc, int i)
 {
     date     = Lib.getDateTime(doc.Body.Strng(i, Decl.RULE_DATE));
     Text     = doc.Body.Strng(i, Decl.RULE_RULETEXT);
     text     = Lib.ToLat(Text.ToLower());
     synonyms = RuleSynParse(text);
     ruleDP   = new DP(text);
     sSupl    = doc.Body.Strng(i, Decl.RULE_SUPPLIERNAME);
     sCS      = doc.Body.Strng(i, Decl.RULE_COMPSETNAME);
     if (date > DateTime.Now || date < Decl.OLD ||
         string.IsNullOrWhiteSpace(Text) ||
         string.IsNullOrWhiteSpace(sSupl) ||
         string.IsNullOrWhiteSpace(sCS))
     {
         throw new InvalidCastException("Rule line " + i);
     }
 }
예제 #7
0
 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));
         }
     }
 }
예제 #8
0
 public Component(DP comp, DP csDP = null)
 {
     compDP = comp;
 }