Esempio n. 1
0
        public JsonResult EditProfiles1(ShopProfileSteps1 shopProfileStep1)
        {
            //公司信息
            Cache.Remove(CacheKeyCollection.CACHE_SHOP(CurrentSellerManager.ShopId, false));
            Cache.Remove(CacheKeyCollection.CACHE_SHOPDTO(CurrentSellerManager.ShopId, false));
            Himall.DTO.Shop shopInfo = ShopApplication.GetShop(CurrentSellerManager.ShopId);
            shopInfo.Id                   = CurrentSellerManager.ShopId;
            shopInfo.CompanyName          = shopProfileStep1.CompanyName;
            shopInfo.CompanyAddress       = shopProfileStep1.Address;
            shopInfo.CompanyRegionId      = shopProfileStep1.CityRegionId;
            shopInfo.CompanyRegionAddress = shopProfileStep1.Address;
            shopInfo.Stage                = ShopInfo.ShopStage.FinancialInfo;
            shopInfo.BusinessLicenseCert  = Request.Form["BusinessLicenseCert"];
            shopInfo.ProductCert          = Request.Form["ProductCert"];
            shopInfo.OtherCert            = Request.Form["OtherCert"];
            shopInfo.IDCard               = shopProfileStep1.IDCard;
            shopInfo.IDCardUrl            = shopProfileStep1.IDCardUrl;
            shopInfo.IDCardUrl2           = shopProfileStep1.IDCardUrl2;
            ShopApplication.UpdateShop(shopInfo);

            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            //管理员信息
            var model = MemberApplication.GetMemberAccountSafety(uid);

            if (shopProfileStep1.MemberPhone.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证手机!" }));
            }

            //修改真实姓名
            var member = MemberApplication.GetMembers(uid);

            member.RealName = shopProfileStep1.RealName;
            MemberApplication.UpdateMember(member);

            if (shopProfileStep1.MemberPhone != null && !shopProfileStep1.MemberPhone.Equals(model.Phone))
            {
                string pluginId = "Himall.Plugin.Message.SMS";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.PhoneCode, shopProfileStep1.MemberPhone, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "手机验证码错误!"; break;

                case -1: strMsg = "此手机号已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }
            return(Json(new { success = true, msg = "成功!" }));
        }
        protected override object OnCheckCheckCodeSuccess(string contact)
        {
            CheckUserLogin();

            string pluginId = PluginsManagement.GetInstalledPluginInfos(Core.Plugins.PluginType.SMS).First().PluginId;

            var _iMemberIntegralConversionFactoryService = ServiceProvider.Instance <IMemberIntegralConversionFactoryService> .Create;
            var _iMemberIntegralService = ServiceProvider.Instance <IMemberIntegralService> .Create;
            var _iMemberInviteService   = ServiceProvider.Instance <IMemberInviteService> .Create;

            var member = CurrentUser;

            if (Application.MessageApplication.GetMemberContactsInfo(pluginId, contact, MemberContactsInfo.UserTypes.General) != null)
            {
                return(Json(new { success = false, msg = contact + "已经绑定过了!" }));
            }
            member.CellPhone = contact;
            MemberApplication.UpdateMember(member.Map <DTO.Members>());
            Application.MessageApplication.UpdateMemberContacts(new MemberContactsInfo()
            {
                Contact = contact, ServiceProvider = pluginId, UserId = CurrentUser.Id, UserType = MemberContactsInfo.UserTypes.General
            });
            Core.Cache.Remove(CacheKeyCollection.MemberPluginCheck(CurrentUser.UserName, pluginId));
            Core.Cache.Remove(CacheKeyCollection.Member(CurrentUser.Id));            //移除用户缓存
            Core.Cache.Remove("Rebind" + CurrentUser.Id);

            UserMemberInfo inviteMember = null;

            if (member.InviteUserId.HasValue)
            {
                inviteMember = Application.MemberApplication.GetMember(member.InviteUserId.Value);
            }

            MemberIntegralRecord info = new MemberIntegralRecord();

            info.UserName   = member.UserName;
            info.MemberId   = member.Id;
            info.RecordDate = DateTime.Now;
            info.TypeId     = MemberIntegral.IntegralType.Reg;
            info.ReMark     = "绑定手机";
            var memberIntegral = _iMemberIntegralConversionFactoryService.Create(MemberIntegral.IntegralType.Reg);

            _iMemberIntegralService.AddMemberIntegral(info, memberIntegral);
            if (inviteMember != null)
            {
                _iMemberInviteService.AddInviteIntegel(member, inviteMember);
            }

            return(base.OnCheckCheckCodeSuccess(contact));
        }
Esempio n. 3
0
 public JsonResult Edit5(string RealName)
 {
     if (!RealName.Equals(""))
     {
         long uid    = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
         var  member = MemberApplication.GetMembers(uid);
         member.RealName = RealName;
         MemberApplication.UpdateMember(member);
         return(Json(new { success = true }));
     }
     else
     {
         return(Json(new { success = false, msg = "真实姓名不能为空" }));
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 验证码验证,认证管理员
        /// </summary>
        /// <param name="pluginId">信息类别</param>
        /// <param name="code">验证码</param>
        /// <param name="destination">联系号码</param>
        /// <param name="userId">会员ID</param>
        /// <returns></returns>
        public static int CheckShopCode(string pluginId, string code, string destination, long userId)
        {
            var member    = MemberApplication.GetMembers(userId);
            int result    = 0;
            var cache     = CacheKeyCollection.MemberPluginCheck(member.UserName, pluginId + destination);
            var cacheCode = Core.Cache.Get <string>(cache);

            if (cacheCode != null && cacheCode == code)
            {
                if (MessageApplication.GetMemberContactsInfo(pluginId, destination, Entities.MemberContactInfo.UserTypes.General) != null)
                {
                    result = -1;
                }
                else
                {
                    if (pluginId.ToLower().Contains("email"))
                    {
                        member.Email = destination;
                    }
                    else if (pluginId.ToLower().Contains("sms"))
                    {
                        member.CellPhone = destination;
                    }

                    MemberApplication.UpdateMember(member);

                    MessageApplication.UpdateMemberContacts(new Entities.MemberContactInfo()
                    {
                        Contact         = destination,
                        ServiceProvider = pluginId,
                        UserId          = userId,
                        UserType        = Entities.MemberContactInfo.UserTypes.General
                    });

                    Core.Cache.Remove(CacheKeyCollection.MemberPluginCheck(member.UserName, pluginId));
                    Core.Cache.Remove(CacheKeyCollection.Member(userId));//移除用户缓存
                    Core.Cache.Remove("Rebind" + userId);
                    result = 1;
                }
            }
            return(result);
        }
Esempio n. 5
0
        public JsonResult EditProfiles1(ShopProfileSteps1 shopProfileStep1)
        {
            //公司信息
            Mall.DTO.Shop shopInfo = ShopApplication.GetShop(CurrentSellerManager.ShopId);
            shopInfo.Id                   = CurrentSellerManager.ShopId;
            shopInfo.CompanyName          = shopProfileStep1.CompanyName;
            shopInfo.CompanyAddress       = shopProfileStep1.Address;
            shopInfo.CompanyRegionId      = shopProfileStep1.CityRegionId;
            shopInfo.CompanyRegionAddress = shopProfileStep1.Address;
            shopInfo.Stage                = Entities.ShopInfo.ShopStage.CompanyInfo;
            shopInfo.BusinessLicenseCert  = Request.Form["BusinessLicenseCert"];
            shopInfo.ProductCert          = Request.Form["ProductCert"];
            shopInfo.OtherCert            = Request.Form["OtherCert"];
            shopInfo.IDCard               = shopProfileStep1.IDCard;
            shopInfo.IDCardUrl            = shopProfileStep1.IDCardUrl;
            shopInfo.IDCardUrl2           = shopProfileStep1.IDCardUrl2;

            ShopApplication.UpdateShop(shopInfo);

            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            //管理员信息
            var mTheme = ShopApplication.GetSettled();
            var model  = MemberApplication.GetMemberAccountSafety(uid);

            if (!mTheme.SelfVerificationType.Equals(Mall.CommonModel.VerificationType.VerifyEmail) && shopProfileStep1.MemberPhone.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证手机!" }));
            }
            if (!mTheme.SelfVerificationType.Equals(Mall.CommonModel.VerificationType.VerifyPhone) && shopProfileStep1.MemberEmail.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证邮箱!" }));
            }

            //修改真实姓名
            var member = MemberApplication.GetMembers(uid);

            member.RealName = shopProfileStep1.RealName;
            MemberApplication.UpdateMember(member);

            //手机认证
            if (shopProfileStep1.MemberPhone != null && !shopProfileStep1.MemberPhone.Equals(model.Phone))
            {
                string pluginId = "Mall.Plugin.Message.SMS";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.PhoneCode, shopProfileStep1.MemberPhone, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "手机验证码错误!"; break;

                case -1: strMsg = "此手机号已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }

            //邮箱认证
            if (shopProfileStep1.MemberEmail != null && !shopProfileStep1.MemberEmail.ToString().Equals(model.Email))
            {
                string pluginId = "Mall.Plugin.Message.Email";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.EmailCode, shopProfileStep1.MemberEmail, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "邮箱验证码错误!"; break;

                case -1: strMsg = "此邮箱已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }


            ShopApplication.SetShopStage(Entities.ShopInfo.ShopStage.FinancialInfo, CurrentSellerManager.ShopId);//设置成功,则才是进入财务信息
            return(Json(new { success = true, msg = "成功!" }));
        }
Esempio n. 6
0
        public JsonResult EditProfile1(ShopProfileStep1 shopProfileStep1)
        {
            if (ShopApplication.ExistCompanyName(shopProfileStep1.CompanyName, CurrentSellerManager.ShopId))
            {
                return(Json(new { success = false, msg = "该公司名已存在!" }));
            }
            if (ShopApplication.ExistBusinessLicenceNumber(shopProfileStep1.BusinessLicenceNumber, CurrentSellerManager.ShopId))
            {
                return(Json(new { success = false, msg = "该营业执照号已存在!" }));
            }

            //公司信息
            Mall.DTO.Shop shopInfo = ShopApplication.GetShop(CurrentSellerManager.ShopId);
            shopInfo.Id                         = CurrentSellerManager.ShopId;
            shopInfo.CompanyName                = shopProfileStep1.CompanyName;
            shopInfo.CompanyAddress             = shopProfileStep1.Address;
            shopInfo.CompanyRegionId            = shopProfileStep1.CityRegionId;
            shopInfo.CompanyRegionAddress       = shopProfileStep1.Address;
            shopInfo.CompanyPhone               = shopProfileStep1.Phone;
            shopInfo.CompanyEmployeeCount       = shopProfileStep1.EmployeeCount;
            shopInfo.CompanyRegisteredCapital   = shopProfileStep1.RegisterMoney;
            shopInfo.ContactsName               = shopProfileStep1.ContactName;
            shopInfo.ContactsPhone              = shopProfileStep1.ContactPhone;
            shopInfo.ContactsEmail              = shopProfileStep1.Email;
            shopInfo.BusinessLicenceNumber      = shopProfileStep1.BusinessLicenceNumber;
            shopInfo.BusinessLicenceRegionId    = shopProfileStep1.BusinessLicenceArea;
            shopInfo.BusinessLicenceStart       = shopProfileStep1.BusinessLicenceValidStart;
            shopInfo.BusinessLicenceEnd         = shopProfileStep1.BusinessLicenceValidEnd;
            shopInfo.BusinessSphere             = shopProfileStep1.BusinessSphere;
            shopInfo.BusinessLicenceNumberPhoto = shopProfileStep1.BusinessLicenceNumberPhoto;
            shopInfo.OrganizationCode           = shopProfileStep1.OrganizationCode;
            shopInfo.OrganizationCodePhoto      = shopProfileStep1.OrganizationCodePhoto;
            shopInfo.GeneralTaxpayerPhot        = shopProfileStep1.GeneralTaxpayerPhoto;
            shopInfo.Stage                      = Entities.ShopInfo.ShopStage.CompanyInfo;
            shopInfo.BusinessLicenseCert        = Request.Form["BusinessLicenseCert"];
            shopInfo.ProductCert                = Request.Form["ProductCert"];
            shopInfo.OtherCert                  = Request.Form["OtherCert"];
            shopInfo.legalPerson                = shopProfileStep1.legalPerson;
            shopInfo.CompanyFoundingDate        = shopProfileStep1.CompanyFoundingDate;

            ShopApplication.UpdateShop(shopInfo);

            //管理员信息
            long uid    = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);
            var  mTheme = ShopApplication.GetSettled();
            var  model  = MemberApplication.GetMemberAccountSafety(uid);

            if (!mTheme.CompanyVerificationType.Equals(VerificationType.VerifyEmail) && shopProfileStep1.MemberPhone.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证手机!" }));
            }
            if (!mTheme.CompanyVerificationType.Equals(Mall.CommonModel.VerificationType.VerifyPhone) && shopProfileStep1.MemberEmail.Equals(""))
            {
                return(Json(new { success = false, msg = "必须认证邮箱!" }));
            }

            //修改真实姓名
            var member = MemberApplication.GetMembers(uid);

            member.RealName = shopProfileStep1.RealName;
            MemberApplication.UpdateMember(member);

            //手机认证
            if (!shopProfileStep1.MemberPhone.Equals(model.Phone))
            {
                string pluginId = "Mall.Plugin.Message.SMS";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.PhoneCode, shopProfileStep1.MemberPhone, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "手机验证码错误!"; break;

                case -1: strMsg = "此手机号已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }

            //邮箱认证
            if (!shopProfileStep1.MemberEmail.Equals(model.Email))
            {
                string pluginId = "Mall.Plugin.Message.Email";
                int    result   = MemberApplication.CheckMemberCode(pluginId, shopProfileStep1.EmailCode, shopProfileStep1.MemberEmail, uid);
                string strMsg   = "";
                switch (result)
                {
                case 0: strMsg = "邮箱验证码错误!"; break;

                case -1: strMsg = "此邮箱已绑定!"; break;
                }
                if (!strMsg.Equals(""))
                {
                    return(Json(new { success = false, msg = strMsg }));
                }
            }

            ShopApplication.SetShopStage(Entities.ShopInfo.ShopStage.FinancialInfo, CurrentSellerManager.ShopId);//设置成功,则才是进入财务信息

            return(Json(new { success = true, msg = "成功!" }));
        }