Exemplo n.º 1
0
        public static DataTable JHViewdataBydwbm(string dwbm)
        {
            string    str = string.Format("select *  from View_BasAsset4 where  DWBM='{0}'", dwbm);
            DataTable dt  = DBUnity.AdapterToTab(str);

            return(dt);
        }
Exemplo n.º 2
0
        public static Print_State GetPrint_StateByPtintID(int ptintID)
        {
            string sql = "SELECT * FROM Print_State WHERE PtintID = @PtintID";

            try
            {
                SqlParameter para = new SqlParameter("@PtintID", ptintID);
                DataTable    dt   = DBUnity.AdapterToTab(sql, para);

                if (dt.Rows.Count > 0)
                {
                    Print_State print_State = new Print_State();

                    print_State.PtintID    = dt.Rows[0]["PtintID"] == DBNull.Value ? 0 : (int)dt.Rows[0]["PtintID"];
                    print_State.PrintBH    = dt.Rows[0]["PrintBH"] == DBNull.Value ? "" : (string)dt.Rows[0]["PrintBH"];
                    print_State.PrintState = dt.Rows[0]["PrintState"] == DBNull.Value ? "" : (string)dt.Rows[0]["PrintState"];
                    print_State.PrintTimes = dt.Rows[0]["PrintTimes"] == DBNull.Value ? 0 : (int)dt.Rows[0]["PrintTimes"];

                    return(print_State);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw e;
            }
        }
Exemplo n.º 3
0
        public static DataTable GetDepDt(string dwbm)
        {
            string    sql = string.Format("select VCDEPTCODE as DepID,VCDEPTNAME as DepName from BASDEPTCODE where UNITCODE='{0}' and  VCDEPTNAME!='系统维护部'", dwbm);
            DataTable dt  = DBUnity.AdapterToTab(sql);

            return(dt);
        }
Exemplo n.º 4
0
        public static DataTable JHDataTableBydwbmdep(string dwbm, string depcode)
        {
            DataTable dt  = null;
            string    sql = string.Format("select *  from View_BasAsset4 where DWBM ='{0}' and SYGLBM='{1}' ORDER BY RZRQ DESC ", dwbm, depcode);

            dt = DBUnity.AdapterToTab(sql);
            return(dt);
        }
Exemplo n.º 5
0
        public static DataTable JHDataTableBystrdwbm(string listassid, string tt, string dwbm)
        {
            DataTable dt  = null;
            string    sql = string.Format("select *  from View_BasAsset4 where  DWBM='{2}' and KPBH in ({0}) and MC='{1}'", listassid, tt, dwbm);

            dt = DBUnity.AdapterToTab(sql);
            return(dt);
        }
Exemplo n.º 6
0
        public static DataTable JHAllDataTableByDWBM(string re, string dwbm)
        {
            DataTable dt  = null;
            string    sql = String.Format("select *  from View_BasAsset4 where (KPBH in ({0})) and DWBM='{1}'", re, dwbm);

            dt = DBUnity.AdapterToTab(sql);
            return(dt);
        }
Exemplo n.º 7
0
 private static DataTable GetPrint_StateBySql(string sql, params SqlParameter[] values)
 {
     try
     {
         DataTable dt = DBUnity.AdapterToTab(sql, values);
         return(dt);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         throw e;
     }
 }
Exemplo n.º 8
0
 private static DataTable GetPrint_StateBySql(string safeSql)
 {
     try
     {
         DataTable dt = DBUnity.AdapterToTab(safeSql);
         return(dt);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         throw e;
     }
 }
Exemplo n.º 9
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));
        }