Exemplo n.º 1
0
        public esn_list shrinklist(bool bezsotr)
        {
            esn_list rez = new esn_list();
            int      i, j;
            bool     find;

            for (i = 0; i < this.Count; i++)
            {
                find = false;
                for (j = 0; j < rez.Count; j++)
                {
                    if ((this[i].month_ == rez[j].month_) && (this[i].sotr_id == rez[j].sotr_id || bezsotr))
                    {
                        foreach (string s in this[i].Keys)
                        {
                            rez[j][s] = rez[j][s] + this[i][s];
                        }
                        find = true;
                    }
                }

                if (!find)
                {
                    Esn_Class ecl = new Esn_Class();
                    ecl.id      = 0;
                    ecl.sotr_id = this[i].sotr_id;
                    ecl.dts_id  = this[i].dts_id;
                    ecl.org_id  = this[i].org_id;
                    ecl.tipsotr = this[i].tipsotr;
                    ecl.squadid = this[i].squadid;
                    ecl.year_   = this[i].year_;
                    ecl.month_  = this[i].month_;
                    ecl.tag     = this[i].tag;

                    ecl.schet      = this[i].schet;
                    ecl.def_prov   = this[i].def_prov;
                    ecl.prov921    = this[i].prov921;
                    ecl.prov922    = this[i].prov922;
                    ecl.prov923    = this[i].prov923;
                    ecl.prov901    = this[i].prov901;
                    ecl.prov911    = this[i].prov911;
                    ecl.prov903    = this[i].prov903;
                    ecl.prov904    = this[i].prov904;
                    ecl.prov924    = this[i].prov924;
                    ecl.sprrash_id = this[i].sprrash_id;

                    //Плавающие поля
                    foreach (string s in this[i].Keys)
                    {
                        ecl.Add(s, this[i][s]);
                    }
                    rez.Add(ecl);
                    find = true;
                }
            }
            return(rez);
        }
Exemplo n.º 2
0
        public esn_list getone(int sotr)
        {
            esn_list rez = new esn_list();
            int      i;

            for (i = 0; i < this.Count; i++)
            {
                if (sotr == this[i].sotr_id)
                {
                    rez.Add(this[i].getcopy());
                }
                ;
            }
            ;
            return(rez);
        }
Exemplo n.º 3
0
        public void frmMain_refrgrd(bool naritog)
        {
            esn_list aresn0 = new esn_list();

            aresn0.get_esn(212, Convert.ToDateTime("01/01/2013"), Convert.ToDateTime("31/12/2013"), naritog, true, false);
            esn_list aresn = aresn0.getone(aresn0[10].sotr_id);

            esn_list arorg = aresn.shrinklist(true);

            int i, j;

            for (i = 1; i < 13; i++)
            {
                bool bfind = true;
                for (j = 0; j < arorg.Count; j++)
                {
                    if (arorg[j].month_ == i)
                    {
                        bfind = false;
                    }
                    ;
                }
                ;
                if (bfind)
                {
                    Esn_Class ecl = new Esn_Class();
                    ecl.year_  = 2013;
                    ecl.month_ = i;
                    ecl.Add("all_sum", 0);
                    ecl.Add("dmppf", 0);
                    ecl.Add("dnepf", 0);
                    ecl.Add("dbazapf", 0);
                    ecl.Add("dpf3", 0);
                    ecl.Add("dpf1", 0);
                    ecl.Add("dpf2", 0);
                    arorg.Add(ecl);
                }
                ;
            }


            arorg.Sort(delegate(Esn_Class ecl1, Esn_Class ecl2)
                       { return(ecl1.month_.CompareTo(ecl2.month_)); });

            stg.RowCount = 12;
            stg.Columns[0].HeaderText  = "ID";
            stg.Columns[1].HeaderText  = @"sotrid";
            stg.Columns[2].HeaderText  = @"god";
            stg.Columns[3].HeaderText  = @"mes";
            stg.Columns[4].HeaderText  = @"all";
            stg.Columns[5].HeaderText  = @"mp";
            stg.Columns[6].HeaderText  = @"ne";
            stg.Columns[7].HeaderText  = @"baza";
            stg.Columns[8].HeaderText  = @"pfstr";
            stg.Columns[9].HeaderText  = @"pfnak";
            stg.Columns[10].HeaderText = @"pfprev";

            for (i = 0; i < 12; i++)
            {
                stg.Rows[i].Cells[0].Value  = Convert.ToString(0);
                stg.Rows[i].Cells[1].Value  = Convert.ToString(0);
                stg.Rows[i].Cells[2].Value  = Convert.ToString(arorg[i].year_);
                stg.Rows[i].Cells[3].Value  = Convert.ToString(arorg[i].month_);
                stg.Rows[i].Cells[4].Value  = Convert.ToString(arorg[i].getstrvalue("all_sum"));
                stg.Rows[i].Cells[5].Value  = Convert.ToString(arorg[i].getstrvalue("dmppf"));
                stg.Rows[i].Cells[6].Value  = Convert.ToString(arorg[i].getstrvalue("dnepf"));
                stg.Rows[i].Cells[7].Value  = Convert.ToString(arorg[i].getstrvalue("dbazapf"));
                stg.Rows[i].Cells[8].Value  = Convert.ToString(arorg[i].getstrvalue("dpf2"));
                stg.Rows[i].Cells[9].Value  = Convert.ToString(arorg[i].getstrvalue("dpf3"));
                stg.Rows[i].Cells[10].Value = Convert.ToString(arorg[i].getstrvalue("dpf1"));
            }
        }