public static WaiveCollection GetTopWaivesByCaseID(Int64 CaseID, int WindowSize) { WaiveCollection c = new WaiveCollection(); SqlCommand cmd = new SqlCommand(); SqlParameterCollection Params = cmd.Parameters; Params.Add(new SqlParameter("CaseID", CaseID)); Params.Add(new SqlParameter("Size", WindowSize)); DataTable dt = Execute.FillDataTable(StoredProcedures.GetTopWaivesByCaseID, Params); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { Waive o = new Waive(); LoadWaiveByReader(row, o); c.Add(o); } } return(c); }
public static WaiveCollection GetWaives(Int64 CaseID, string SearchText, Int64 ContractID, Int64 MilestoneID, Nullable <DateTime> EstOrderDateFrom, Nullable <DateTime> EstOrderDateTo) { WaiveCollection c = new WaiveCollection(); SqlCommand cmd = new SqlCommand(); SqlParameterCollection Params = cmd.Parameters; Params.Add(new SqlParameter("CaseID", CaseID)); if (ContractID > 0) { Params.Add(new SqlParameter("ContractID", ContractID)); } if (MilestoneID > 0) { Params.Add(new SqlParameter("MilestoneID", MilestoneID)); } if (EstOrderDateFrom != null && EstOrderDateFrom > new DateTime(1755)) { Params.Add(new SqlParameter("EstOrderDateFrom", EstOrderDateFrom)); } if (EstOrderDateTo != null) { Params.Add(new SqlParameter("EstOrderDateTo", EstOrderDateTo)); } if (SearchText != null) { Params.Add(new SqlParameter("SearchText", SearchText)); } DataTable dt = Execute.FillDataTable(StoredProcedures.GetWaives, Params); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { Waive o = new Waive(); LoadWaiveByReader(row, o); c.Add(o); } } return(c); }
public static WaiveCollection GetWaivesByCaseID(Int64 CaseID, int Ammount) { WaiveCollection c = new WaiveCollection(); DataTable dt = Execute.FillDataTable(StoredProcedures.GetWaivesByCaseID, new System.Data.SqlClient.SqlParameter("CaseID", CaseID)); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { Waive o = new Waive(); LoadWaiveByReader(row, o); c.Add(o); } } return(c); }
public static void LoadWaiveByReader(DataRow row, Waive o) { o.ID = Convert.ToInt64(row["ID"]); o.Title = row["Title"].ToString(); o.EstOrderDate = Convert.ToDateTime(row["EstOrderDate"]); o.Location = row["Location"].ToString(); o.Message = row["Message"].ToString(); o.Requisition = row["Requisition"].ToString(); o.IsOrdered = Convert.ToBoolean(row["IsOrdered"]); if (row["OrderDate"] != DBNull.Value) { o.OrderDate = Convert.ToDateTime(row["OrderDate"]); } else { o.OrderDate = null; } o.CaseID = Convert.ToInt64(row["CaseID"]); o.ContractID = Convert.ToInt64(row["ContractID"]); o.MilestoneID = Convert.ToInt64(row["MilestoneID"]); o.ActivityID = Convert.ToInt64(row["ActivityID"]); o.IsExtra = Convert.ToBoolean(row["IsExtra"]); }