/// <summary> /// 修改财务预算单信息 /// </summary> /// <param name="OfficeThingsBuyM">领用单主信息</param> /// <param name="OfficeThingsUsedInfos">领用单详细信息</param> /// <returns>添加是否成功 false:失败,true:成功</returns> public static bool UpdateFinacialBudgerInfo(FinancialBudgetModel FinacialBudget_Model, string BudgetInfo, string userID) { try { #region 添加财务预算主表信息sql语句 StringBuilder BudgetSql = new StringBuilder(); BudgetSql.AppendLine("UPDATE officedba.Financialbudgetbill"); BudgetSql.AppendLine("SET Title=@Title"); BudgetSql.AppendLine(",DeptID=@DeptID "); BudgetSql.AppendLine(",StartDate=@StartDate "); BudgetSql.AppendLine(",EndDate=@EndDate "); BudgetSql.AppendLine(",PayType=@PayType"); BudgetSql.AppendLine(",CurrencyType=@CurrencyType"); BudgetSql.AppendLine(",CurrencyRate=@CurrencyRate"); BudgetSql.AppendLine(",Budgetcost=@Budgetcost"); BudgetSql.AppendLine(",FinancialBudgetType=@FinancialBudgetType"); BudgetSql.AppendLine(",Remark=@Remark"); BudgetSql.AppendLine(",ModifiedUserID=@ModifiedUserID"); BudgetSql.AppendLine(",ModifiedDate=@ModifiedDate"); BudgetSql.AppendLine("WHERE CompanyCD=@CompanyCD AND BudgetCD=@BudgetCD"); #endregion #region 设置参数 SqlParameter[] paramgas = new SqlParameter[14]; paramgas[0] = SqlHelper.GetParameter("@Title", FinacialBudget_Model.Title); paramgas[1] = SqlHelper.GetParameter("@DeptID", FinacialBudget_Model.DeptID); paramgas[2] = SqlHelper.GetParameter("@StartDate", FinacialBudget_Model.StartDate); paramgas[3] = SqlHelper.GetParameter("@EndDate", FinacialBudget_Model.EndDate); paramgas[4] = SqlHelper.GetParameter("@PayType", FinacialBudget_Model.PayType); paramgas[5] = SqlHelper.GetParameter("@CurrencyType", FinacialBudget_Model.CurrencyType); paramgas[6] = SqlHelper.GetParameter("@CurrencyRate", FinacialBudget_Model.CurrencyRate); paramgas[7] = SqlHelper.GetParameter("@Budgetcost", FinacialBudget_Model.Budgetcost); paramgas[8] = SqlHelper.GetParameter("@Remark", FinacialBudget_Model.Remark); paramgas[9] = SqlHelper.GetParameter("@CompanyCD", FinacialBudget_Model.CompanyCD); paramgas[10] = SqlHelper.GetParameter("@BudgetCD", FinacialBudget_Model.BudgetCD); paramgas[11] = SqlHelper.GetParameter("@ModifiedUserID", userID); paramgas[12] = SqlHelper.GetParameter("@ModifiedDate", System.DateTime.Now); paramgas[13] = SqlHelper.GetParameter("@FinancialBudgetType", FinacialBudget_Model.FinancialBudgetType); #endregion return(UpdateAll(BudgetSql.ToString(), BudgetInfo, FinacialBudget_Model.BudgetCD, FinacialBudget_Model.CompanyCD, paramgas)); } catch { return(false); } }
/// <summary> /// 添加财务预算单信息 /// </summary> /// <param name="FinacialBudget_Model">预算单主信息</param> /// <param name="BudgetInfo">预算单详细信息</param> /// <returns>添加是否成功 false:失败,true:成功</returns> public static bool InserFinacialBudgerInfo(FinancialBudgetModel FinacialBudget_Model, string BudgetInfo, string userID, out int RetValID) { try { #region 添加财务预算主表信息sql语句 StringBuilder BudgetSql = new StringBuilder(); BudgetSql.AppendLine("INSERT INTO officedba.Financialbudgetbill"); BudgetSql.AppendLine("(CompanyCD"); BudgetSql.AppendLine(",BudgetCD "); BudgetSql.AppendLine(",Title"); BudgetSql.AppendLine(",DeptID "); BudgetSql.AppendLine(",StartDate "); BudgetSql.AppendLine(",EndDate "); BudgetSql.AppendLine(",Billstatus "); BudgetSql.AppendLine(",Creator "); BudgetSql.AppendLine(",CreateDate "); BudgetSql.AppendLine(",PayType"); BudgetSql.AppendLine(",CurrencyType"); BudgetSql.AppendLine(",CurrencyRate"); BudgetSql.AppendLine(",Budgetcost"); BudgetSql.AppendLine(",FinancialBudgetType"); BudgetSql.AppendLine(",Remark"); BudgetSql.AppendLine(",ModifiedUserID"); BudgetSql.AppendLine(",ModifiedDate)"); BudgetSql.AppendLine(" values "); BudgetSql.AppendLine("(@CompanyCD"); BudgetSql.AppendLine(",@BudgetCD "); BudgetSql.AppendLine(",@Title"); BudgetSql.AppendLine(",@DeptID "); BudgetSql.AppendLine(",@StartDate "); BudgetSql.AppendLine(",@EndDate "); BudgetSql.AppendLine(",@Billstatus "); BudgetSql.AppendLine(",@Creator "); BudgetSql.AppendLine(",@CreateDate "); BudgetSql.AppendLine(",@PayType"); BudgetSql.AppendLine(",@CurrencyType"); BudgetSql.AppendLine(",@CurrencyRate"); BudgetSql.AppendLine(",@Budgetcost"); BudgetSql.AppendLine(",@FinancialBudgetType"); BudgetSql.AppendLine(",@Remark"); BudgetSql.AppendLine(",@ModifiedUserID"); BudgetSql.AppendLine(",@ModifiedDate)"); BudgetSql.AppendLine("set @ID=@@IDENTITY"); #endregion #region 设置参数 SqlParameter[] paramgas = new SqlParameter[18]; paramgas[0] = SqlHelper.GetParameter("@CompanyCD", FinacialBudget_Model.CompanyCD); paramgas[1] = SqlHelper.GetParameter("@BudgetCD", FinacialBudget_Model.BudgetCD); paramgas[2] = SqlHelper.GetParameter("@Title", FinacialBudget_Model.Title); paramgas[3] = SqlHelper.GetParameter("@DeptID", FinacialBudget_Model.DeptID); paramgas[4] = SqlHelper.GetParameter("@StartDate", FinacialBudget_Model.StartDate); paramgas[5] = SqlHelper.GetParameter("@EndDate", FinacialBudget_Model.EndDate); paramgas[6] = SqlHelper.GetParameter("@Billstatus", FinacialBudget_Model.Billstatus); paramgas[7] = SqlHelper.GetParameter("@Creator", FinacialBudget_Model.Creator); paramgas[8] = SqlHelper.GetParameter("@CreateDate", FinacialBudget_Model.CreateDate); paramgas[9] = SqlHelper.GetParameter("@PayType", FinacialBudget_Model.PayType); paramgas[10] = SqlHelper.GetParameter("@CurrencyType", FinacialBudget_Model.CurrencyType); paramgas[11] = SqlHelper.GetParameter("@CurrencyRate", FinacialBudget_Model.CurrencyRate); paramgas[12] = SqlHelper.GetParameter("@Budgetcost", FinacialBudget_Model.Budgetcost); paramgas[13] = SqlHelper.GetParameter("@Remark", FinacialBudget_Model.Remark); paramgas[14] = SqlHelper.GetParameter("@ModifiedUserID", userID); paramgas[15] = SqlHelper.GetParameter("@ModifiedDate", System.DateTime.Now); paramgas[16] = SqlHelper.GetParameter("@FinancialBudgetType", FinacialBudget_Model.FinancialBudgetType); paramgas[17] = SqlHelper.GetOutputParameter("@ID", SqlDbType.Int); #endregion return(InsertAll(BudgetSql.ToString(), BudgetInfo, FinacialBudget_Model.BudgetCD, FinacialBudget_Model.CompanyCD, paramgas, out RetValID)); } catch { RetValID = 0; return(false); } }