/// <summary> /// 获取杂费收入信息合计 /// </summary> /// <param name="model">杂费信息查询实体</param> /// <param name="haveUserIds">用户Id集合,半角逗号分割</param> /// <param name="isIncome">收入 or 支出 (1:收入;0:支出)</param> /// <param name="totalAmount">总合计金额</param> public void GetOtherIncomeList(Model.FinanceStructure.OtherCostQuery model, string haveUserIds, bool isIncome , ref decimal totalAmount) { if (model == null) { return; } string strOrder = string.Empty; var strSql = new StringBuilder(); strSql.Append(" select sum(SumCost) from tbl_TourOtherCost "); string strWhere = GetSqlWhereByQueryModel(model, haveUserIds , isIncome ? Model.EnumType.FinanceStructure.CostType.收入 : Model.EnumType.FinanceStructure.CostType.支出 , ref strOrder); if (!string.IsNullOrEmpty(strWhere)) { strSql.AppendFormat(" where {0} ", strWhere); } DbCommand dc = _db.GetSqlStringCommand(strSql.ToString()); using (IDataReader dr = DbHelper.ExecuteReader(dc, _db)) { if (dr.Read()) { if (!dr.IsDBNull(0)) { totalAmount = dr.GetDecimal(0); } } } }
/// <summary> /// 获取杂费支出信息金额合计 /// </summary> /// <param name="model">杂费信息查询实体</param> /// <param name="totalAmount">总合计金额</param> public void GetOtherOutList(Model.FinanceStructure.OtherCostQuery model, ref decimal totalAmount) { if (model == null) { return; } idal.GetOtherIncomeList(model, HaveUserIds, false, ref totalAmount); }