public static void rasesnall(int god, int mes, int org_id) { List <Int32> sotrlist = new List <Int32>(); using (FbConnection fbBD = new FbConnection(FBDB.GetConnFBstring())) { fbBD.Open(); using (FbCommand sqlreq = new FbCommand("select sotrid from sumnu where god_v=@g and mes_v<=@m group by sotrid ", fbBD)) { sqlreq.Parameters.AddWithValue("@g", Convert.ToString(god)); sqlreq.Parameters.AddWithValue("@m", Convert.ToString(mes)); FbDataReader r = sqlreq.ExecuteReader(); sotrlist.Clear(); while (r.Read()) { sotrlist.Add(r.GetInt32(0)); } ; }; fbBD.Close(); }; esn_list aresn = new esn_list(); esn_list aresnpred = new esn_list(); aresnpred.get_esn(212, new DateTime(god, mes, 1), new DateTime(god, mes, 31), true, true, false); aresn.build_esn(212, god, mes); int i; for (i = 0; i < sotrlist.Count; i++) { esn_list aresn1 = aresn.getone(sotrlist[i]); esn_list aresnpred1 = aresnpred.getone(sotrlist[i]); rasesnone(god, mes, sotrlist[i], aresn1, aresnpred1); } ; }
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")); } }