Ejemplo n.º 1
0
 public void Copy(RULE R)
 {
     ID   = R.ID;
     Name = R.Name;
     Node.Copy(R.Node);
 }
Ejemplo n.º 2
0
        public static string CreateSELECTString(RULE Rule)
        {
            byte check = 0;
            NODE Node  = new NODE();

            Node.Copy(Rule.Node);
            string Str = Properties.Resources.SelectAllString + '\n';

            while (true)
            {
                if (Node.SostoanieZdorovia.FF != 0)
                {
                    Str += $" WHRERE (SZ.FF={Node.SostoanieZdorovia.FF} OR SZ.FS={Node.SostoanieZdorovia.FF} OR  SZ.FT={Node.SostoanieZdorovia.FF}) AND ( ";
                    ++check;
                    break;
                }
                if (Node.SostoanieZdorovia.FS != 0)
                {
                    Str += $" WHRERE (SZ.FS={Node.SostoanieZdorovia.FF} OR  SZ.FT={Node.SostoanieZdorovia.FF}) AND ( ";
                    ++check;
                    break;
                }
                if (Node.SostoanieZdorovia.FT != 0)
                {
                    Str += " WHRERE SZ.FT=" + Node.SostoanieZdorovia.FT + " AND ( ";
                    ++check;
                }
                break;
            }
            if (Node.AktivniiOtdih.FF != 0)
            {
                Str += " OR AO.FF=" + Node.AktivniiOtdih.FF;
                ++check;
            }
            if (Node.AktivniiOtdih.FS != 0)
            {
                Str += " OR AO.FS=" + Node.AktivniiOtdih.FS;
                ++check;
            }
            if (Node.AktivniiOtdih.FT != 0)
            {
                Str += " OR AO.FT=" + Node.AktivniiOtdih.FT;
                ++check;
            }
            if (Node.OtdihVKompanii.FF != 0)
            {
                Str += " OR OvK.FF=" + Node.OtdihVKompanii.FF;
                ++check;
            }
            if (Node.OtdihVKompanii.FS != 0)
            {
                Str += " OR OvK.FS=" + Node.OtdihVKompanii.FS;
                ++check;
            }
            if (Node.Prirodu != 0)
            {
                Str += " OR R.Priroda=" + Node.Prirodu;
                ++check;
            }
            if (Node.OtdihNaPrirode != 0)
            {
                Str += " OR R.OtdihNaPrirode=" + Node.OtdihNaPrirode;
                ++check;
            }
            if (Node.Arhitectura.FF != 0)
            {
                Str += " OR A.FF=" + Node.Arhitectura.FF;
                ++check;
            }
            if (Node.Arhitectura.FS != 0)
            {
                Str += " OR A.FS=" + Node.Arhitectura.FS;
                ++check;
            }
            if (Node.BolshieGoroda.FF != 0)
            {
                Str += " OR BG.FF=" + Node.BolshieGoroda.FF;
                ++check;
            }
            if (Node.BolshieGoroda.FS != 0)
            {
                Str += " OR BG.FS=" + Node.BolshieGoroda.FS;
                ++check;
            }
            if (Node.BolshieGoroda.FT != 0)
            {
                Str += " OR BG.FT=" + Node.BolshieGoroda.FT;
                ++check;
            }
            if (Node.MalenkieGoroda.FF != 0)
            {
                Str += " OR MG.FF=" + Node.MalenkieGoroda.FF;
                ++check;
            }
            if (Node.MalenkieGoroda.FS != 0)
            {
                Str += " OR MG.FS=" + Node.MalenkieGoroda.FS;
                ++check;
            }
            if (Node.Dostoprimechatelnosti != 0)
            {
                Str += " OR R.Dostoprimech=" + Node.Dostoprimechatelnosti;
                ++check;
            }
            if (Node.VoennaaTematika.FF != 0)
            {
                Str += " OR VT.FF=" + Node.VoennaaTematika.FF;
                ++check;
            }
            if (Node.VoennaaTematika.FS != 0)
            {
                Str += " OR VT.FS=" + Node.VoennaaTematika.FS;
                ++check;
            }
            if (Node.Reki.FF != 0)
            {
                Str += " OR Re.FF=" + Node.Reki.FF;
                ++check;
            }
            if (Node.Reki.FS != 0)
            {
                Str += " OR Re.FS=" + Node.Reki.FS;
                ++check;
            }
            if (Node.Reki.FT != 0)
            {
                Str += " OR Re.FT=" + Node.Reki.FT;
                ++check;
            }
            if (Node.Gori.FF != 0)
            {
                Str += " OR G.FF=" + Node.Gori.FF;
                ++check;
            }
            if (Node.Gori.FS != 0)
            {
                Str += " OR G.FS=" + Node.Gori.FS;
                ++check;
            }
            if (Node.Gori.FT != 0)
            {
                Str += " OR G.FT=" + Node.Gori.FT;
                ++check;
            }

            if (Node.Temp_Hight.FF != 0)
            {
                Str += " OR TH.FF=" + Node.Temp_Hight.FF;
                ++check;
            }
            if (Node.Temp_Hight.FS != 0)
            {
                Str += " OR TH.FS=" + Node.Temp_Hight.FS;
                ++check;
            }
            if (Node.Temp_Low.FF != 0)
            {
                Str += " OR TL.FF=" + Node.Temp_Low.FF;
                ++check;
            }
            if (Node.Temp_Low.FS != 0)
            {
                Str += " OR TL.FS=" + Node.Temp_Low.FS;
                ++check;
            }
            if (Node.Temp_Srednaa != 0)
            {
                Str += " OR R.TempSred=" + Node.Temp_Srednaa;
                ++check;
            }
            if (check == 0)
            {
                Str = Properties.Resources.SelectAllString;
            }
            else
            {
                Str += " );";
            }

            return(Str);
        }