Beispiel #1
0
        /// <summary>
        /// 账户详情
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="pass"></param>
        /// <returns></returns>
        public adminInfo adminInfo(int ID)
        {
            adminInfo admin = null;
            string    sql   = "select * from tbl_admin_User where id = " + ID;

            try
            {
                using (DataTable dt = helper.GetDataTable(sql))
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        Dictionary <int, smsChannelSetting> Dic  = new _SmsChannelSetting().GetSmsChannelSettingDic();
                        Dictionary <int, smsChannel>        DicC = new _SmsChannel().GetSmsChannelDic();
                        DataRow r = dt.Rows[0];
                        admin = new adminInfo
                        {
                            ID        = Convert.ToInt16(r["id"]),
                            CorpName  = r["CorpName"].ToString(),
                            LoginName = r["LoginName"].ToString(),
                            Limits    = r["limits"].ToString(),
                            RoleID    = Convert.ToInt16(r["RoleID"]),
                            Mobile    = r["mobile"].ToString(),
                            Memo      = r["memo"].ToString(),
                            Contact   = r["Contact"].ToString(),
                            Enable    = Convert.ToInt16(r["enable"]),
                            Account   = Convert.ToInt32(r["Account"]),
                            AddOn     = Convert.ToDateTime(r["addOn"])
                        };
                        if (Dic.ContainsKey(admin.ID))
                        {
                            admin.channelSet = Dic[admin.ID];
                            if (DicC.ContainsKey(admin.channelSet.ChannelID))
                            {
                                admin.channel = DicC[admin.channelSet.ChannelID];
                            }
                        }
                    }
                }
            }
            catch
            {
            }
            return(admin);
        }
Beispiel #2
0
        /// <summary>
        /// 获取列表
        /// </summary>
        /// <param name="isService"></param>
        /// <param name="workNo"></param>
        /// <returns></returns>
        public List <adminInfo> GetAdminUserList(string sql)
        {
            List <adminInfo> le = null;

            using (DataTable dt = helper.GetDataTable(sql))
            {
                if (dt != null && dt.Rows.Count > 0)
                {
                    le = new List <adminInfo>();
                    Dictionary <int, smsChannelSetting> Dic  = new _SmsChannelSetting().GetSmsChannelSettingDic();
                    Dictionary <int, smsChannel>        DicC = new _SmsChannel().GetSmsChannelDic();
                    foreach (DataRow r in dt.Rows)
                    {
                        adminInfo e = new adminInfo
                        {
                            ID        = Convert.ToInt16(r["id"]),
                            CorpName  = r["CorpName"].ToString(),
                            LoginName = r["LoginName"].ToString(),
                            Limits    = r["limits"].ToString(),
                            RoleID    = Convert.ToInt16(r["RoleID"]),
                            Mobile    = r["mobile"].ToString(),
                            Memo      = r["memo"].ToString(),
                            Contact   = r["Contact"].ToString(),
                            Enable    = Convert.ToInt16(r["enable"]),
                            Account   = Convert.ToInt32(r["Account"]),
                            AddOn     = Convert.ToDateTime(r["addOn"])
                        };
                        if (Dic.ContainsKey(e.ID))
                        {
                            e.channelSet = Dic[e.ID];
                            if (DicC.ContainsKey(e.channelSet.ChannelID))
                            {
                                e.channel = DicC[e.channelSet.ChannelID];
                            }
                        }
                        le.Add(e);
                    }
                }
            }
            return(le);
        }