Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="levelEnum"></param>
        /// <returns></returns>
        static public DataTable GetWaterUserDataTable(WaterUserLevelEnum levelEnum)
        {
            int    levelID = WaterUserLevelDBI.GetWaterUserLevelID(levelEnum);
            string s       = string.Format("select * from tblWaterUser where deleted = 0 and waterUserLevelID = {0}",
                                           levelID);
            DataTable tbl = DBI.GetDBI().ExecuteDataTable(s);

            return(tbl);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        internal static WaterUserLevelCollection CreateWaterUserLevelCollection()
        {
            WaterUserLevelCollection wulc = new WaterUserLevelCollection();
            DataTable tbl = WaterUserLevelDBI.GetWaterUserLevelDataTable();

            foreach (DataRow row in tbl.Rows)
            {
                WaterUserLevel wul = CreateWaterUserLevel(row);
                wulc.Add(wul);
            }
            return(wulc);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="wulEnum"></param>
        /// <returns></returns>
        static public WaterUserLevel CreateWaterLevel(WaterUserLevelEnum wulEnum)
        {
            DataTable tbl = WaterUserLevelDBI.GetWaterUserLevelDataTableByOrdinal((int)wulEnum);

            if (tbl.Rows.Count > 0)
            {
                int            wulID = Convert.ToInt32(tbl.Rows[0]["WaterUserlevelID"]);
                WaterUserLevel l     = WaterUserLevelFactory.CreateWaterUserLevelByID(wulID);
                return(l);
            }
            return(null);
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="waterUserLevelID"></param>
        /// <returns></returns>
        static public WaterUserLevel CreateWaterUserLevelByID(int waterUserLevelID)
        {
            WaterUserLevel l   = null;
            DataTable      tbl = WaterUserLevelDBI.GetWaterUserLevelDataTable(waterUserLevelID);

            if (tbl.Rows.Count > 0)
            {
                DataRow r = tbl.Rows[0];
                l = CreateWaterUserLevel(r);
            }
            else
            {
                string err = string.Format("not find waterUserLevel by id '{0}'", waterUserLevelID);
                log.Error(err);
            }
            return(l);
        }