示例#1
0
        public void Enable(MessageTypeEnum e)
        {
            CheckCanEnable();
            if (dic.Where(a => a.Key == e).FirstOrDefault().Value == Mall.Core.Plugins.Message.StatusEnum.Disable)
            {
                throw new Mall.Core.MallException("该功能已被禁止,不能进行设置");
            }
            SetMessageStatus(e, StatusEnum.Open);
            //using (FileStream fs = new FileStream(EmailCore.WorkDirectory + "/Data/config.xml", FileMode.Create))
            //{
            //    XmlSerializer xs = new XmlSerializer(typeof(MessageStatus));
            //    xs.Serialize(fs, messageStatus);
            //}

            EmailCore.SaveMessageStatus(messageStatus);
        }
示例#2
0
        void InitMessageStatus()
        {
            #region 原读取本地方法
            //DirectoryInfo dir = new DirectoryInfo(EmailCore.WorkDirectory);
            ////查找该目录下的
            //var configFile = dir.GetFiles("Data/config.xml").FirstOrDefault();
            //if (configFile != null)
            //{
            //    using (FileStream fs = new FileStream(configFile.FullName, FileMode.Open))
            //    {
            //        XmlSerializer xs = new XmlSerializer(typeof(MessageStatus));
            //        messageStatus = (MessageStatus)xs.Deserialize(fs);
            //        dic.Clear();
            //        dic.Add(MessageTypeEnum.FindPassWord, (StatusEnum)messageStatus.FindPassWord);
            //        dic.Add(MessageTypeEnum.OrderCreated, (StatusEnum)messageStatus.OrderCreated);
            //        dic.Add(MessageTypeEnum.OrderPay, (StatusEnum)messageStatus.OrderPay);
            //        dic.Add(MessageTypeEnum.OrderRefund, (StatusEnum)messageStatus.OrderRefund);
            //        dic.Add(MessageTypeEnum.OrderShipping, (StatusEnum)messageStatus.OrderShipping);
            //        dic.Add(MessageTypeEnum.ShopAudited, (StatusEnum)messageStatus.ShopAudited);
            //        //2.4删除
            //        // dic.Add(MessageTypeEnum.ShopSuccess, (StatusEnum)messageStatus.ShopSuccess);去掉
            //        dic.Add(MessageTypeEnum.ShopHaveNewOrder, (StatusEnum)messageStatus.ShopHaveNewOrder);
            //        dic.Add(MessageTypeEnum.ReceiveBonus, (StatusEnum)messageStatus.ReceiveBonus);
            //        dic.Add(MessageTypeEnum.LimitTimeBuy, (StatusEnum)messageStatus.LimitTimeBuy);
            //        dic.Add(MessageTypeEnum.SubscribeLimitTimeBuy, (StatusEnum)messageStatus.SubscribeLimitTimeBuy);
            //        dic.Add(MessageTypeEnum.RefundDeliver, (StatusEnum)messageStatus.RefundDeliver);

            //        #region 拼团
            //        dic.Add(MessageTypeEnum.FightGroupOpenSuccess, (StatusEnum)messageStatus.FightGroupOpenSuccess);
            //        dic.Add(MessageTypeEnum.FightGroupJoinSuccess, (StatusEnum)messageStatus.FightGroupJoinSuccess);
            //        dic.Add(MessageTypeEnum.FightGroupNewJoin, (StatusEnum)messageStatus.FightGroupNewJoin);
            //        dic.Add(MessageTypeEnum.FightGroupFailed, (StatusEnum)messageStatus.FightGroupFailed);
            //        dic.Add(MessageTypeEnum.FightGroupSuccess, (StatusEnum)messageStatus.FightGroupSuccess);
            //        #endregion

            //        //发送优惠券
            //        dic.Add(MessageTypeEnum.SendCouponSuccess, (StatusEnum)messageStatus.SendCouponSuccess);
            //    }
            //}
            #endregion

            messageStatus = EmailCore.GetMessageStatus();
            if (messageStatus != null)
            {
                dic.Clear();

                dic.Add(MessageTypeEnum.EditPayPassWord, (StatusEnum)messageStatus.EditPayPassWord);
                dic.Add(MessageTypeEnum.EditLoginPassWord, (StatusEnum)messageStatus.EditLoginPassWord);
                dic.Add(MessageTypeEnum.OrderCreated, (StatusEnum)messageStatus.OrderCreated);
                dic.Add(MessageTypeEnum.OrderPay, (StatusEnum)messageStatus.OrderPay);
                dic.Add(MessageTypeEnum.OrderShipping, (StatusEnum)messageStatus.OrderShipping);
                dic.Add(MessageTypeEnum.OrderRefundApply, (StatusEnum)messageStatus.OrderRefundApply);
                dic.Add(MessageTypeEnum.OrderRefundSuccess, (StatusEnum)messageStatus.OrderRefundSuccess);
                dic.Add(MessageTypeEnum.OrderRefundFail, (StatusEnum)messageStatus.OrderRefundFail);
                dic.Add(MessageTypeEnum.OrderReturnApply, (StatusEnum)messageStatus.OrderReturnApply);
                dic.Add(MessageTypeEnum.OrderReturnSuccess, (StatusEnum)messageStatus.OrderReturnSuccess);
                dic.Add(MessageTypeEnum.OrderReturnFail, (StatusEnum)messageStatus.OrderReturnFail);

                #region 拼团
                dic.Add(MessageTypeEnum.FightGroupOpenSuccess, (StatusEnum)messageStatus.FightGroupOpenSuccess);
                dic.Add(MessageTypeEnum.FightGroupJoinSuccess, (StatusEnum)messageStatus.FightGroupJoinSuccess);
                dic.Add(MessageTypeEnum.FightGroupFailed, (StatusEnum)messageStatus.FightGroupFailed);
                dic.Add(MessageTypeEnum.FightGroupSuccess, (StatusEnum)messageStatus.FightGroupSuccess);
                #endregion

                dic.Add(MessageTypeEnum.SelfTakeOrderPay, (StatusEnum)messageStatus.SelfTakeOrderPay);
                dic.Add(MessageTypeEnum.AlreadyVerification, (StatusEnum)messageStatus.AlreadyVerification);

                dic.Add(MessageTypeEnum.VirtualOrderPay, (StatusEnum)messageStatus.VirtualOrderPay);
                dic.Add(MessageTypeEnum.VirtualAlreadyVerification, (StatusEnum)messageStatus.VirtualAlreadyVerification);

                dic.Add(MessageTypeEnum.DistributorApply, (StatusEnum)messageStatus.DistributorApply);
                dic.Add(MessageTypeEnum.DistributorAuditSuccess, (StatusEnum)messageStatus.DistributorAuditSuccess);
                dic.Add(MessageTypeEnum.DistributorAuditFail, (StatusEnum)messageStatus.DistributorAuditFail);
                dic.Add(MessageTypeEnum.DistributorNewJoin, (StatusEnum)messageStatus.DistributorNewJoin);
                dic.Add(MessageTypeEnum.DistributorCommissionSettled, (StatusEnum)messageStatus.DistributorCommissionSettled);

                dic.Add(MessageTypeEnum.MemberWithDrawApply, (StatusEnum)messageStatus.MemberWithDrawApply);
                dic.Add(MessageTypeEnum.MemberWithDrawSuccess, (StatusEnum)messageStatus.MemberWithDrawSuccess);
                dic.Add(MessageTypeEnum.MemberWithDrawFail, (StatusEnum)messageStatus.MemberWithDrawFail);

                dic.Add(MessageTypeEnum.ShopOrderShipping, (StatusEnum)messageStatus.ShopOrderShipping);
                dic.Add(MessageTypeEnum.ShopDelivering, (StatusEnum)messageStatus.ShopDelivering);

                //3.2删除 TDO:ZYF
                //dic.Add(MessageTypeEnum.FindPassWord, (StatusEnum)messageStatus.FindPassWord);
                //dic.Add(MessageTypeEnum.OrderRefund, (StatusEnum)messageStatus.OrderRefund);
                //dic.Add(MessageTypeEnum.OrderShipping, (StatusEnum)messageStatus.OrderShipping);
                //dic.Add(MessageTypeEnum.ShopAudited, (StatusEnum)messageStatus.ShopAudited);
                ////2.4删除
                //// dic.Add(MessageTypeEnum.ShopSuccess, (StatusEnum)messageStatus.ShopSuccess);去掉
                //dic.Add(MessageTypeEnum.ShopHaveNewOrder, (StatusEnum)messageStatus.ShopHaveNewOrder);
                //dic.Add(MessageTypeEnum.ReceiveBonus, (StatusEnum)messageStatus.ReceiveBonus);
                //dic.Add(MessageTypeEnum.LimitTimeBuy, (StatusEnum)messageStatus.LimitTimeBuy);
                //dic.Add(MessageTypeEnum.SubscribeLimitTimeBuy, (StatusEnum)messageStatus.SubscribeLimitTimeBuy);
                //dic.Add(MessageTypeEnum.RefundDeliver, (StatusEnum)messageStatus.RefundDeliver);
                //#region 拼团
                //dic.Add(MessageTypeEnum.FightGroupNewJoin, (StatusEnum)messageStatus.FightGroupNewJoin);
                //#endregion
                ////发送优惠券
                //dic.Add(MessageTypeEnum.SendCouponSuccess, (StatusEnum)messageStatus.SendCouponSuccess);
                //dic.Add(MessageTypeEnum.GetBrokerage, (StatusEnum)messageStatus.GetBrokerage);
            }
        }
示例#3
0
        public Core.Plugins.FormData GetFormData()
        {
            var config = EmailCore.GetConfig();

            var formData = new Core.Plugins.FormData()
            {
                Items = new Core.Plugins.FormData.FormItem[] {
                    //SmtpServer
                    new  Core.Plugins.FormData.FormItem()
                    {
                        DisplayName = "SMTP服务器",
                        Name        = "SmtpServer",
                        IsRequired  = true,
                        Type        = Core.Plugins.FormData.FormItemType.text,
                        Value       = config.SmtpServer
                    },
                    new  Core.Plugins.FormData.FormItem()
                    {
                        DisplayName = "SMTP服务器端口",
                        Name        = "SmtpPort",
                        IsRequired  = true,
                        Type        = Core.Plugins.FormData.FormItemType.text,
                        Value       = config.SmtpPort
                    },
                    new  Core.Plugins.FormData.FormItem()
                    {
                        DisplayName = "SMTP用户名",
                        Name        = "EmailName",
                        IsRequired  = true,
                        Type        = Core.Plugins.FormData.FormItemType.text,
                        Value       = config.EmailName
                    },
                    new  Core.Plugins.FormData.FormItem()
                    {
                        DisplayName = "SMTP用户密码",
                        Name        = "Password",
                        IsRequired  = true,
                        Type        = Core.Plugins.FormData.FormItemType.password,
                        Value       = config.Password
                    },
                    new  Core.Plugins.FormData.FormItem()
                    {
                        DisplayName = "SMTP邮箱",
                        Name        = "SendAddress",
                        IsRequired  = true,
                        Type        = Core.Plugins.FormData.FormItemType.text,
                        Value       = config.SendAddress
                    },
                    new  Core.Plugins.FormData.FormItem()
                    {
                        DisplayName = "显示名称",
                        Name        = "DisplayName",
                        IsRequired  = true,
                        Type        = Core.Plugins.FormData.FormItemType.text,
                        Value       = config.DisplayName
                    },
                    new  Core.Plugins.FormData.FormItem()
                    {
                        DisplayName = "开启SSL",
                        Name        = "EnableSsl",
                        IsRequired  = true,
                        Type        = Core.Plugins.FormData.FormItemType.checkbox,
                        Value       = config.EnableSsl.ToString()
                    }
                }
            };

            return(formData);
        }