예제 #1
0
        public CM_UserListEntity GetUserInfoByCardNo(string cardNo)
        {
            CM_UserListEntity userListModel = new CM_UserListEntity();
            userListModel.UserKahao = cardNo;
            Dictionary<string, object> args = new Dictionary<string, object>();

            List<CM_UserListEntity> listUser = null;
            using (ICM_UserListService userlist = new CM_UserListService(new DataAccess("defaultRead")))
            {
                listUser = userlist.GetCM_UserListCollection(args);
            }

            using (ICM_UserListService userlist = new CM_UserListService())
            {
                userListModel = listUser[10];
                userListModel.UserKahao = "01020102";
                var list = userlist.InsertCM_UserListEntity(userListModel);
            }

            SearchEntity entity = new SearchEntity("GetCM_UserListEntityByKahao", System.Data.CommandType.StoredProcedure);
            entity["UserKahao"] = cardNo;
            using (IDbExecuter service = new ExCommonService())
            {
                var uList = service.ExecuteSelect<CM_UserListEntity>(entity).ToList();
                userListModel = uList.Count > 0 ? uList[0] : null;
            }

            return userListModel;
        }
 /// <summary>
 /// 根据Entity获取 CM_UserList实体
 /// </summary>
 /// <param name="item">CM_UserList的实体</param>
 /// <returns>CM_UserListEntity 对象</returns>
 public virtual CM_UserListEntity GetCM_UserListEntity(CM_UserListEntity item)
 {
     try
     {
         new CM_UserListDBO(dac).GetCM_UserListEntity(item);
         return item;
     }
     catch (Exception ex)
     {
         throw new CommonException(ex, CommonDeclare.EnumExceptionLevel.ERROR);
     }
 }
 /// <summary>
 /// 插入CM_UserList实体
 /// </summary>
 /// <param name="item">CM_UserList的实体</param>
 /// <returns>返回插入后获取的CM_UserList实体</returns>
 public virtual CM_UserListEntity InsertCM_UserListEntity(CM_UserListEntity item)
 {
     try
     {
          if ((dac.Scope == null))
         {
             using (CommonScope scope = new CommonScope(dac))
             {
                 new CM_UserListDBO(dac).InsertCM_UserListEntity(item);
                 scope.Complete();
                 return item;
             }
         }
         else
         {
             new CM_UserListDBO(dac).InsertCM_UserListEntity(item);
             return item;
         }
     }
     catch (System.Exception ex)
     {
         throw new CommonException(ex, CommonDeclare.EnumExceptionLevel.ERROR);
     }
 }
예제 #4
0
 /// <summary>
 /// Update Entity by Key
 /// </summary>
 /// <param name="item">Entity</param>
 public virtual void UpdateCM_UserListEntity(CM_UserListEntity item)
 {
     this.UpdateByKey("UpdateCM_UserListEntity", item);
 }
예제 #5
0
 /// <summary>
 /// Insert Entity by Key
 /// </summary>
 /// <param name="item">Entity</param>
 public virtual void InsertCM_UserListEntity(CM_UserListEntity item)
 {
     this.InsertEntity("InsertCM_UserListEntity", item);
 }
예제 #6
0
 /// <summary>
 /// Get Entity by id.
 /// </summary>
 /// <param name="entityID"></param>
 /// <returns>Entity</returns>
 public virtual CM_UserListEntity GetCM_UserListEntityByID(string entityID)
 {
     CM_UserListEntity item = new CM_UserListEntity();
     item.EntityID = entityID;
     this.GetCM_UserListEntity(item);
     return item;
 }
예제 #7
0
 /// <summary>
 /// Get Entity by Key
 /// </summary>
 /// <param name="item">Entity</param>
 public virtual void GetCM_UserListEntity(CM_UserListEntity item)
 {
     this.GetByKey("GetCM_UserListEntity", item);
 }
예제 #8
0
 /// <summary>
 /// Get All
 /// </summary>
 /// <param name="args">args</param>
 /// <returns>List</returns>
 public virtual List<CM_UserListEntity> GetCM_UserListCollection(Dictionary<string, object> args)
 {
     CM_UserListEntity item = new CM_UserListEntity();
     return (List<CM_UserListEntity>)this.GetAllBySP("GetCM_UserListCollection", item, args);
 }
예제 #9
0
        /// <summary>
        /// 设置登录后的cookie
        /// </summary>
        /// <param name="userListModel"></param>
        private void SetLoginCookie(CM_UserListEntity userListModel)
        {
            if (HttpContext.Request.Cookies["RSUser"] != null)
            {
                HttpContext.Request.Cookies["RSUser"].Expires = DateTime.Now.AddDays(-1);
                HttpContext.Response.Cookies.Add(HttpContext.Request.Cookies["RSUser"]);
            }

            HttpCookie myCookie = new HttpCookie("RSUser");

            //WriteLog.LogResult(dt.Rows[0]["u_kahao"].ToString(), dt.Rows[0]["u_diqu"].ToString());//日志
            myCookie.Values["u_id"] = Convert.ToString(userListModel.UserID);
            myCookie.Values["u_kahao"] = userListModel.UserKahao;
            //myCookie.Values["u_xingming"] = HttpUtility.UrlEncode(userListModel.UserName);
            myCookie.Values["u_xingming"] = HttpUtility.UrlEncode(userListModel.UserName);
            string dq = Convert.ToString(userListModel.DiquID);
            myCookie.Values["u_diqu"] = dq;
            myCookie.Values["u_zhiwu"] = Convert.ToString(userListModel.ZhiWu);
            myCookie.Values["u_bumen"] = Convert.ToString(userListModel.BuMen);
            myCookie.Values["u_jibie"] = Convert.ToString(userListModel.JiBie);
            myCookie.Values["u_zhuangtai"] = Convert.ToString(userListModel.ZhuangTai);
            //myCookie.Values["u_gzJinCheng"] = Convert.ToString(userListModel.u_gzJinCheng);
            //rsgl_jueseEntity jueSeEntity = GetRoleById(Convert.ToString(userListModel.u_jibie));
            myCookie.Values["js_IsGroup"] = Convert.ToString(userListModel.isGroup);
            myCookie.Expires = DateTime.Now.AddDays(1);

            //添加cookie
            HttpContext.Response.Cookies.Add(myCookie);
        }