Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        internal static WaterUserTypeCollection CreateWaterUserTypeCollection()
        {
            WaterUserTypeCollection wutc = new WaterUserTypeCollection();
            DataTable tbl = WaterUserTypeDBI.GetWaterUserTypeDataTable();

            foreach (DataRow row in tbl.Rows)
            {
                WaterUserType t = CreateWaterUserType(row);
                wutc.Add(t);
            }
            return(wutc);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        internal static WaterUserType CreateManagerWaterUserType()
        {
            WaterUserType t   = null;
            DataTable     tbl = WaterUserTypeDBI.GetManagerWaterUserDataTable();

            if (tbl.Rows.Count > 0)
            {
                DataRow row = tbl.Rows[0];
                t = CreateWaterUserType(row);
            }
            return(t);
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        static public WaterUserType CreateDefaultWaterUserType()
        {
            DataTable tbl = WaterUserTypeDBI.GetDefaultWaterUserTypeDataTable();

            if (tbl.Rows.Count > 0)
            {
                WaterUserType t = CreateWaterUserType(tbl.Rows[0]);
                return(t);
            }
            else
            {
                string exmsg = "cannot find default water user type";
                throw new InvalidOperationException(exmsg);
            }
        }
Пример #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        static public WaterUserType CreateWaterUserTypeByID(int id)
        {
            WaterUserType wut = null;
            DataTable     tbl = WaterUserTypeDBI.GetWaterUserTypeDataTable(id);

            if (tbl.Rows.Count > 0)
            {
                DataRow row = tbl.Rows[0];
                wut = CreateWaterUserType(row);
            }
            else
            {
                string err = string.Format("not find water user type by id '{0}'", id);
                log.Error(err);
            }
            return(wut);
        }