Exemplo n.º 1
0
 public static int EditBudgetInfo(BudgetSummary budgetSummary, XBase.Common.UserInfoUtil userinfo)
 {
     return ProjectBudgetDBHelper.EditBudgetInfo(budgetSummary, userinfo);
 }
 public static int EditBudgetInfo(BudgetSummary budgetSummary, XBase.Common.UserInfoUtil userinfo)
 {
     StringBuilder sqlstr = new StringBuilder();
     sqlstr.Append(@"update officedba.budgetSummary set 
                     BudgetName=@BudgetName,budgetUnit=@budgetUnit,budgetArea=@budgetArea,
                     projectID=@projectID,seq=@seq,subBudgetID=@subBudgetID where budgetID=@budgetID");
     SqlParameter[] param = {
                                new SqlParameter("@budgetID",SqlDbType.VarChar,50),
                                new SqlParameter("@BudgetName",SqlDbType.VarChar,500),
                                new SqlParameter("@budgetUnit",SqlDbType.Int,4),
                                new SqlParameter("@budgetArea",SqlDbType.Decimal),
                                new SqlParameter("@projectID",SqlDbType.Int),
                                new SqlParameter("@seq",SqlDbType.Int),
                                new SqlParameter("@subBudgetID",SqlDbType.Int)
                            };
     param[0].Value = budgetSummary.budgetID;
     param[1].Value = budgetSummary.BudgetName;
     param[2].Value = budgetSummary.budgetUnit;
     param[3].Value = budgetSummary.budgetArea;
     param[4].Value = budgetSummary.projectid;
     param[5].Value = budgetSummary.seq;
     param[6].Value = budgetSummary.SubBudgetID;
     TransactionManager tran = new TransactionManager();
     int num = 0;
     tran.BeginTransaction();
     try
     {
         num = SqlHelper.ExecuteNonQuery(tran.Trans, CommandType.Text, sqlstr.ToString(), param);
         tran.Commit();
     }
     catch
     {
         tran.Rollback();
     }
     return num;
 }