public string DeleteEstimate(EstimateEntity estimate)
        {
            const string sql = @"uspDelete_Estimate";

            object[] parms = { "@RefID", estimate.RefId };
            return(Db.Delete(sql, true, parms));
        }
 private object[] Take(EstimateEntity estimate)
 {
     return(new object[]
     {
         "@RefId", estimate.RefId,
         "@RefTypeId", estimate.RefTypeId,
         "@RefNo", estimate.RefNo,
         "@RefDate", estimate.RefDate,
         "@PostedDate", estimate.PostedDate,
         "@PlanTemplateListId", estimate.PlanTemplateListId,
         "@YearOfPlaning", estimate.YearOfPlaning,
         "@CurrencyCode", estimate.CurrencyCode,
         "@ExchangeRate", estimate.ExchangeRate,
         "@TotalEstimateAmount", estimate.TotalEstimateAmount,
         "@NextYearOfTotalEstimateAmount", estimate.NextYearOfTotalEstimateAmount,
         "@JournalMemo", estimate.JournalMemo,
         "@BudgetSourceCategoryID", estimate.BudgetSourceCategoryId,
         "@ExchangeRateLastYear", estimate.ExchangeRateLastYear,
         "@ExchangeRateThisYear", estimate.ExchangeRateThisYear
     });
 }
        public string UpdateEstimate(EstimateEntity estimate)
        {
            const string sql = @"uspUpdate_Estimate";

            return(Db.Update(sql, true, Take(estimate)));
        }
        public int InsertEstimate(EstimateEntity estimate)
        {
            const string sql = @"uspInsert_Estimate";

            return(Db.Insert(sql, true, Take(estimate)));
        }