Пример #1
0
        /// <summary>
        /// 获取用户授权公司
        /// </summary>
        /// <param name="UserID">用户ID</param>
        /// <returns></returns>
        public DataTable GetAuthorizePropertyinfo(int UserID)
        {
            DataTable   dt           = new DataTable();
            UserInfoDAL userinfo_dal = new UserInfoDAL();
            //授权小区列表
            List <AuthCommunityModel> CommunityList = userinfo_dal.GetAuthCommunity(UserID);
            List <int> propertyList = new List <int>();

            if (CommunityList.Count > 0)
            {
                propertyList = CommunityList.Select(x => x.propertyMId).Distinct().ToList <int>();
                PropertyInfoDAL property_dal = new PropertyInfoDAL();
                string          sqlwhere     = " AND propertyID in(" + string.Join(",", propertyList) + ")";
                dt = property_dal.GetAllPropertyinfoList(sqlwhere);
            }
            return(dt);
        }
Пример #2
0
        /// <summary>
        /// 添加用户日志
        /// </summary>
        /// <param name="uid">用户id</param>
        /// <param name="propertyName">所属小区名字</param>
        ///<param name="operationName">操作描述</param>
        public void addUserLog(int uid, string operationName)
        {
            //string uid = HttpContext.Current.Request.Cookies["userinfo"]["userid"];
            // List<propertyinfo> propertyinfolist = null;
            UserInfoBLL     userinfo_bll = new UserInfoBLL();
            PropertyInfoDAL property_dal = new PropertyInfoDAL();
            var             u            = userinfo_bll.GetModel(uid);
            var             pid          = property_dal.GetPropertyID(u.companyName);
            int             a            = pid[0].propertyID;
            var             userlog      = new UserLogModel()
            {
                userID = uid,

                OperationTime = DateTime.Now.ToString(),
                OperationName = operationName,
                IsDel         = false,
                PropertyName  = u.companyName,
                Pid           = pid[0].propertyID
            };

            Add(userlog);
        }