/// <summary> /// Deprecated Method for adding a new object to the ThroughputHistory EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToThroughputHistory(ThroughputHistory throughputHistory) { base.AddObject("ThroughputHistory", throughputHistory); }
public static List<ThroughputHistory> GetHistories(string client) { List<ThroughputHistory> result = new List<ThroughputHistory>(); using (SqlConnection con = new SqlConnection(connectionStr)) { SqlCommand com = new SqlCommand("GetHistories", con); com.CommandType = System.Data.CommandType.StoredProcedure; com.Parameters.Add("@client", System.Data.SqlDbType.NVarChar, 50).Value = client; con.Open(); SqlDataReader sr = com.ExecuteReader(); if (sr.HasRows) { ThroughputHistory tmp; while (sr.Read()) { tmp = new ThroughputHistory(); tmp.Client = client; tmp.Date = DateTime.Parse(sr["Date"].ToString()); tmp.Line = sr["Line"].ToString(); tmp.Throughput = new Throughput(); tmp.Throughput.Name = sr["name"].ToString(); result.Add(tmp); } } } return result; }
/// <summary> /// Create a new ThroughputHistory object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="client">Initial value of the Client property.</param> /// <param name="date">Initial value of the Date property.</param> public static ThroughputHistory CreateThroughputHistory(global::System.Int32 id, global::System.String client, global::System.DateTime date) { ThroughputHistory throughputHistory = new ThroughputHistory(); throughputHistory.Id = id; throughputHistory.Client = client; throughputHistory.Date = date; return throughputHistory; }