public static int EditSubBudget(SubBudgetModel subBudgetModel, XBase.Common.UserInfoUtil userinfo)
 {
     StringBuilder sqlstr = new StringBuilder();
     sqlstr.Append("update officedba.SubBudget set BudgetName=@BudgetName,projectid=@projectid where ID=@ID");
     SqlParameter[] param = {
                                new SqlParameter("@BudgetName",SqlDbType.VarChar,200),
                                new SqlParameter("@projectid",SqlDbType.Int,4),
                                new SqlParameter("@ID",SqlDbType.Int)
                            };
     param[0].Value = subBudgetModel.BudgetName;
     param[1].Value = subBudgetModel.Projectid;
     param[2].Value = subBudgetModel.ID;
     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;
 }
        public static int AddSubBudgetInfo(SubBudgetModel subBudgetModel, XBase.Common.UserInfoUtil userinfo)
        {
            StringBuilder sqlstr = new StringBuilder();
            sqlstr.Append("insert into officedba.SubBudget(CompanyCD,projectid,BudgetName) values(@CompanyCD,@projectid,@BudgetName)");
            SqlParameter[] param = {
                                       new SqlParameter("@CompanyCD",SqlDbType.VarChar,50),
                                       new SqlParameter("@projectid",SqlDbType.Int),
                                       new SqlParameter("@BudgetName",SqlDbType.VarChar,200)
                                   };
            param[0].Value = userinfo.CompanyCD;
            param[1].Value = subBudgetModel.Projectid;
            param[2].Value = subBudgetModel.BudgetName;

            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;
        }
Example #3
0
 public static int EditSubBudget(SubBudgetModel subBudgetModel, XBase.Common.UserInfoUtil userinfo)
 {
     return SubBudgetDBHelper.EditSubBudget(subBudgetModel, userinfo);
 }
Example #4
0
 public static int AddSubBudgetInfo(SubBudgetModel subBudgetModel, XBase.Common.UserInfoUtil userinfo)
 {
     return SubBudgetDBHelper.AddSubBudgetInfo(subBudgetModel, userinfo);
 }