Пример #1
0
        /// <summary>
        /// 注册会员信息
        /// </summary>
        /// <param name="AccountId">帐号ID</param>
        /// <param name="Phone">电话</param>
        /// <param name="CellPhone">手机</param>
        /// <param name="Referrer">推荐人</param>
        /// <returns>返回是否成功</returns>
        public bool InsertRegInfo(Guid AccountId, string Phone, string CellPhone)
        {
            Member member = new Member();

            member.Id              = new Guid();
            member.AccountId       = AccountId;
            member.ConsigneePhone1 = DESEncryptTools.Encrypt(Phone);
            member.ConsigneePhone2 = DESEncryptTools.Encrypt(CellPhone);
            member.Sex             = 0;
            member.Birthday        = DateTime.Now;
            member.SyncStatus      = "I";
            return((int)Add(member) > 0);
        }
Пример #2
0
        public JsonResult Login(string username, string password, string wxToken = null)
        {
            bool hasInput = !string.IsNullOrWhiteSpace(username) && !string.IsNullOrWhiteSpace(password);
            //门店暂时不做微信登陆
            //bool wxLogin = !string.IsNullOrWhiteSpace(wxToken);

            //C_UserInfo userInfo = null;
            DishStore store = null;
            //if (!string.IsNullOrWhiteSpace(wxToken))
            //{
            //    int userId = 0;
            //    int.TryParse(DESEncryptTools.DESEncrypt(wxToken), out userId);
            //    userInfo = C_UserInfoBLL.SingleModel.GetModel(userId);
            //    DishStoreBLL.SingleModel.GetStoreByUserId(userInfo.Id);
            //}

            string loginToken = string.Empty;

            if (store != null)
            {
                loginToken = DESEncryptTools.Encrypt(store.id.ToString());
            }
            else if (hasInput)
            {
                store = DishStoreBLL.SingleModel.GetAdminByLoginParams(username, password);
                if (store == null)
                {
                    return(ApiModel(message: "用户名或密码错误"));
                }
                loginToken = DESEncryptTools.DESEncrypt(store.id.ToString());
            }
            else
            {
                return(ApiModel(message: "用户名和密码不能为空"));
            }

            return(ApiModel(isok: true, message: "登陆成功", data: new { loginToken, storeId = store.id }));
        }