Пример #1
0
        public ResultModel <string> DelUsers(UpdateWeixinUserRQ rq)
        {
            var user   = Wexin_User.FindById(rq.Id);
            int nCount = user.Delete();

            return(new ResultModel <string>
            {
                state = nCount,
                message = nCount > 0 ? "删除成功!" : "操作失败!",
                data = nCount.ToString()
            });
        }
Пример #2
0
        /// <summary>
        /// 保存理财师信息
        /// </summary>
        /// <param name="rq"></param>
        /// <returns></returns>

        public ResultModel <string> SaveUsers(UpdateWeixinUserRQ rq)
        {
            EntityList <Wexin_User> users = new EntityList <Wexin_User>();
            var user = Wexin_User.FindById(rq.Id);

            if (null == user)
            {
                user             = new Wexin_User();
                user.City        = rq.City;
                user.Country     = rq.Country;
                user.Create_time = DateTime.Now;
                user.Headimgurl  = rq.Headimgurl;
                user.LoginTime   = DateTime.Now;
                user.Nickname    = rq.Nickname;
                user.Open_Id     = rq.Open_Id;
                user.Password    = rq.Password;
                user.Province    = rq.Province;
                user.Sex         = rq.Sex;
                //user.TelePhone = rq.TelePhone;
                user.Unionid = rq.Unionid;
            }
            user.Username   = rq.Username;
            user.Password   = rq.Password;
            user.TelePhone  = rq.TelePhone;
            user.Remark     = rq.Remark;
            user.RoleId     = rq.RoleId;
            user.IsPrice    = rq.IsPrice;
            user.Ident      = rq.Ident;
            user.CardNo     = rq.CardNo;
            user.BankName   = rq.BankName;
            user.Company    = rq.Company;
            user.CompCity   = rq.CompCity;
            user.Department = rq.Department;
            user.Position   = rq.Position;
            users.Add(user);
            int nCount = users.Save();

            return(new ResultModel <string>
            {
                state = nCount,
                message = nCount > 0 ? "保存成功!" : "操作失败!",
                data = nCount.ToString()
            });
        }