/// <summary> /// Takes the specified estimate. /// </summary> /// <param name="estimate">The estimate.</param> /// <returns></returns> private static object[] Take(EstimateDetailEntity estimate) { return(new object[] { "@RefDetailID", estimate.RefDetailId, "@RefID", estimate.RefId, "@BudgetItemCode", estimate.BudgetItemCode, "@PreviousYearOfEstimateAmount", estimate.PreviousYearOfEstimateAmount, "@PreviousYearOfEstimateAmountUSD", estimate.PreviousYearOfEstimateAmountUSD, "@TotalEstimateAmountUSD", estimate.TotalEstimateAmountUSD, "@YearOfEstimateAmount", estimate.YearOfEstimateAmount, "@NextYearOfEstimateAmount", estimate.NextYearOfEstimateAmount, "@AutonomyBudget", estimate.AutonomyBudget, "@NonAutonomyBudget", estimate.NonAutonomyBudget, "@TotalNextYearOfEstimateAmount", estimate.TotalNextYearOfEstimateAmount, "@Description", estimate.Description, "@PreviousYearOfAutonomyBudget", estimate.PreviousYearOfAutonomyBudget, "@PreviousYearOfNonAutonomyBudget", estimate.PreviousYearOfNonAutonomyBudget, "@YearOfAutonomyBudget", estimate.YearOfAutonomyBudget, "@YearOfNonAutonomyBudget", estimate.YearOfNonAutonomyBudget, "@SixMonthBeginingAutonomyBudget", estimate.SixMonthBeginingAutonomyBudget, "@SixMonthBeginingNonAutonomyBudget", estimate.SixMonthBeginingNonAutonomyBudget, "@TotalAmountSixMonthBegining", estimate.TotalAmountSixMonthBegining, "@SixMonthEndingAutonomyBudget", estimate.SixMonthEndingAutonomyBudget, "@SixMonthEndingNonAutonomyBudget", estimate.SixMonthEndingNonAutonomyBudget, "@TotalAmountSixMonthEnding", estimate.TotalAmountSixMonthEnding, "@PreviousYeaOfAutonomyBudgetBalance", estimate.PreviousYeaOfAutonomyBudgetBalance, "@PreviousYeaOfNonAutonomyBudgetBalance", estimate.PreviousYeaOfNonAutonomyBudgetBalance, "@TotalPreviousYearBalance", estimate.TotalPreviousYearBalance, "@ThisYearOfAutonomyBudget", estimate.ThisYearOfAutonomyBudget, "@ThisYearOfNonAutonomyBudget", estimate.ThisYearOfNonAutonomyBudget, "@TotalAmountThisYear", estimate.TotalAmountThisYear, "@ItemCodeList", estimate.ItemCodeList }); }
/// <summary> /// LINHMC - 21/8/2015 /// Updates the estimate detail. /// </summary> /// <param name="estimateDetail">The estimate detail.</param> /// <returns></returns> public string UpdateEstimateDetail(EstimateDetailEntity estimateDetail) { const string sql = @"uspUpdate_EstimateDetail"; return(Db.Update(sql, true, Take(estimateDetail))); }
/// <summary> /// Inserts the estimate detail. /// </summary> /// <param name="estimateDetail">The estimate detail.</param> /// <returns></returns> public int InsertEstimateDetail(EstimateDetailEntity estimateDetail) { const string sql = @"uspInsert_EstimateDetail"; return(Db.Insert(sql, true, Take(estimateDetail))); }