public List <Yol_bazinda_uretim_ozet> d_hh_ybuo_data_read(string tarih, string firma = "DILER", string unite = "HH-ORTAK") { List <Yol_bazinda_uretim_ozet> ybuo = new List <Yol_bazinda_uretim_ozet>(); string sql_hh_ortak = "SELECT BILGITNM,K1,K2,K14 FROM API_DB_001_Y " + "WHERE TARIH=" + tarih + " AND FIRMA='" + firma + "' AND UNITE='" + unite + "' AND TABLOTIP='URETIM_OZET' " + "ORDER BY CAST(BILGISIRANO AS INT)"; this.cmd.CommandText = sql_hh_ortak; this.dr = this.cmd.ExecuteReader(); if (!this.dr.HasRows) { //kayit bulunamadiysa Yol_bazinda_uretim_ozet uo = new Yol_bazinda_uretim_ozet(); uo.Vrd = "Listelenecek kayıt bulunamadı."; uo.Ybu_id = 0; ybuo.Add(uo); } else { try { while (this.dr.Read()) { Yol_bazinda_uretim_ozet uo = new Yol_bazinda_uretim_ozet(); uo.Ybu_id = 1; uo.Vrd = this.dr[0].ToString(); uo.Yol = this.dr[1].ToString(); // uo.Net_urt = Convert.ToDouble(this.dr[2].ToString().Equals("") ? "0.0" : this.dr[2]).ToString("###.###.###"); uo.Net_urt = this.dr[2].ToString(); uo.Mamul = this.dr[3].ToString(); ybuo.Add(uo); } } catch { throw; } } this.dr.Close(); this.dr.Dispose(); return(ybuo); }
public List <Yol_bazinda_uretim_ozet> d_hh_ybuo_data_read(string tarih) { List <Yol_bazinda_uretim_ozet> ybuo = new List <Yol_bazinda_uretim_ozet>(); this.sql = "SELECT VRD, YOL,SUM(TPAKTON)+ SUM(TSTDPAKTON), CAP, BOY FROM VERIM " + "WHERE TARIH = " + tarih + " GROUP BY VRD, CAP, YOL, BOY ORDER BY VRD "; this.cmd.CommandText = this.sql; this.dr = this.cmd.ExecuteReader(); if (!this.dr.HasRows) { //kayit bulunamadiysa Yol_bazinda_uretim_ozet uo = new Yol_bazinda_uretim_ozet(); uo.Vrd = "Listelenecek kayıt bulunamadı."; uo.Ybu_id = 0; ybuo.Add(uo); } else { try { while (this.dr.Read()) { Yol_bazinda_uretim_ozet uo = new Yol_bazinda_uretim_ozet(); uo.Ybu_id = 1; uo.Vrd = this.dr[0].ToString(); uo.Yol = this.dr[1].ToString(); uo.Net_urt = Convert.ToDouble(this.dr[2].ToString().Equals("") ? "0.0" : this.dr[2]).ToString("###.###.###"); uo.Mamul = this.dr[3].ToString() + "mm N D" + " " + this.dr[4].ToString() + "m"; ybuo.Add(uo); } } catch { throw new System.InvalidOperationException("Bağlantı gerçekleştirilirken bir hata oluştu.Tekrar deneyiniz!"); } } this.dr.Close(); this.dr.Dispose(); return(ybuo); }