예제 #1
0
        /// <summary>
        /// Method to get CSC alarm filter columns information
        /// </summary>
        /// <param name="lscId">lscId</param>
        /// <param name="uId">uId</param>
        public List <ACSFilterInfo> GetCSCAlarmFilterCols(int lscId, string uId)
        {
            try {
                SqlParameter[] parms = { new SqlParameter("@LscID", SqlDbType.Int),
                                         new SqlParameter("@UID",   SqlDbType.VarChar, 20) };
                parms[0].Value = lscId;
                parms[1].Value = uId;

                using (var conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction)) {
                    var items = SqlHelper.ExecuteScalar(conn, CommandType.Text, SqlText.SQL_SELECT_SETTING_GETCSCALARMFILTERCOLS, parms);
                    return(ComUtility.DBNullAlarmStaticFiterItemHandler(items));
                }
            } catch { throw; }
        }
예제 #2
0
파일: User.cs 프로젝트: radtek/PecsSystem
        /// <summary>
        /// Method to get LSC user
        /// </summary>
        /// <param name="uId">uId</param>
        /// <param name="pwd">pwd</param>
        public List <LscUserInfo> GetUser(string uId, string pwd)
        {
            SqlParameter[] parms = { new SqlParameter("@UID", SqlDbType.VarChar, 20),
                                     new SqlParameter("@PWD", SqlDbType.VarChar, 20) };
            parms[0].Value = uId;
            if (pwd == null)
            {
                parms[1].Value = DBNull.Value;
            }
            else
            {
                parms[1].Value = pwd;
            }

            var lscUsers = new List <LscUserInfo>();

            using (var rdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, CommandType.Text, SqlText.SQL_SELECT_USER_GETUSER, parms)) {
                while (rdr.Read())
                {
                    var lscUser = new LscUserInfo();
                    lscUser.LscID                 = ComUtility.DBNullInt32Handler(rdr["LscID"]);
                    lscUser.LscName               = ComUtility.DBNullStringHandler(rdr["LscName"]);
                    lscUser.UserID                = ComUtility.DBNullInt32Handler(rdr["UserID"]);
                    lscUser.UserName              = ComUtility.DBNullStringHandler(rdr["UserName"]);
                    lscUser.UID                   = ComUtility.DBNullStringHandler(rdr["UID"]);
                    lscUser.OpLevel               = ComUtility.DBNullUserLevelHandler(rdr["OpLevel"]);
                    lscUser.LimitTime             = ComUtility.DBNullDateTimeHandler(rdr["LimitTime"]);
                    lscUser.TelePhone             = ComUtility.DBNullStringHandler(rdr["TelePhone"]);
                    lscUser.MobilePhone           = ComUtility.DBNullStringHandler(rdr["MobilePhone"]);
                    lscUser.Email                 = ComUtility.DBNullStringHandler(rdr["Email"]);
                    lscUser.Address               = ComUtility.DBNullStringHandler(rdr["Address"]);
                    lscUser.PostalCode            = ComUtility.DBNullStringHandler(rdr["PostalCode"]);
                    lscUser.Remark                = ComUtility.DBNullStringHandler(rdr["Remark"]);
                    lscUser.AlarmSoundFiterItem   = ComUtility.DBNullAlarmSoundFiterItemHandler(rdr["AlarmSoundFiterItem"]);
                    lscUser.AlarmStaticFiterItem  = ComUtility.DBNullAlarmStaticFiterItemHandler(rdr["AlarmStaticFiterItem"]);
                    lscUser.ActiveValuesFiterItem = ComUtility.DBNullActiveValuesFiterItemHandler(rdr["ActiveValuesFiterItem"]);
                    lscUser.Group                 = null;
                    lscUser.UDGroups              = null;
                    lscUser.Enabled               = ComUtility.DBNullBooleanHandler(rdr["Enabled"]);
                    lscUsers.Add(lscUser);
                }
            }
            return(lscUsers);
        }