Esempio n. 1
0
        public static bool ModifyPrint_State(Print_State print_State)
        {
            string sql =
                "UPDATE Print_State " +
                "SET " +
                "PrintBH = @PrintBH, " +
                "PrintState = @PrintState, " +
                "PrintTimes = @PrintTimes " +
                "WHERE PtintID = @PtintID";


            try
            {
                SqlParameter[] para = new SqlParameter[]
                {
                    new SqlParameter("@PtintID", print_State.PtintID),
                    new SqlParameter("@PrintBH", print_State.PrintBH),
                    new SqlParameter("@PrintState", print_State.PrintState),
                    new SqlParameter("@PrintTimes", print_State.PrintTimes)
                };

                int t = DBUnity.ExecuteNonQuery(CommandType.Text, sql, para);
                if (t > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw e;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 分页方法(存储过程)
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public static DataTable GetAspNetPagerProc(string procName, int PageIndex, int PageSize, SqlParameter[] para)
        {
            int startRecord = PageIndex * PageSize;

            return(DBUnity.AdapterToTabProc(procName, startRecord, PageSize, para));
        }
Esempio n. 3
0
        /// <summary>
        /// 分页方法
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public static DataTable GetAspNetPager(string sqlStr, int PageIndex, int PageSize)
        {
            int startRecord = PageIndex * PageSize;

            return(DBUnity.AdapterToTab(sqlStr, startRecord, PageSize));
        }