Esempio n. 1
0
        public bool SwitchingMode(Chain.Model.SysParameter modelParameter)
        {
            string      strStartGood          = "66,67,69,76,87,91,113,114,118";
            string      strStartWeiXin        = "98,120,121,122,123,124,125,126,127,128,129,130,131";
            string      strStartTimingProject = "87,110,111,113,114";
            string      strStartMemCount      = "66,76,118";
            string      strStartGoodBar       = "60";
            string      strStartWeiXinBar     = "119";
            List <bool> ststus = new List <bool>
            {
                PubFunction.curParameter.EnableGoods,
                PubFunction.curParameter.EnableGoods,
                modelParameter.IsStartWeiXin,
                modelParameter.IsStartWeiXin,
                modelParameter.IsStartTimingProject,
                modelParameter.IsStartMemCount
            };
            List <string> moduleIDs = new List <string>
            {
                strStartGoodBar,
                strStartGood,
                strStartWeiXinBar,
                strStartWeiXin,
                strStartTimingProject,
                strStartMemCount
            };

            Chain.BLL.SysParameter bllUpdateParameter = new Chain.BLL.SysParameter();
            return(bllUpdateParameter.SwitchingMode(ststus, moduleIDs));
        }
Esempio n. 2
0
 protected void btnExtraParameter_Click(object sender, EventArgs e)
 {
     Chain.Model.SysParameter modelParameter = new Chain.Model.SysParameter();
     modelParameter.ParameterID   = 1;
     modelParameter.Sms           = this.chkSms.Checked;
     modelParameter.MoneySms      = this.chkMoneySms.Checked;
     modelParameter.IsSmsShopName = this.chkIsSmsShopName.Checked;
     modelParameter.SmsShopName   = this.txtSmsShopName.Text.Trim();
     modelParameter.SmsSeries     = this.txtNotificationSMS.Text.Trim();
     modelParameter.SmsSerialPwd  = ((this.txtNotificationSMSPwd.Text.Trim() == "") ? this.curParameter.strNotificationSMSPwd : this.txtNotificationSMSPwd.Text.Trim());
     modelParameter.MMS           = this.chkMMS.Checked;
     modelParameter.MMSSeries     = this.txtMMSSeries.Text.Trim();
     modelParameter.MMSSerialPwd  = ((this.txtMMSSeriesPwd.Text.Trim() == "") ? this.curParameter.strMMSSerialPwd : this.txtMMSSeriesPwd.Text.Trim());
     modelParameter.Tel           = this.chkTel.Checked;
     modelParameter.TelNoMember   = this.chkTelNoMember.Checked;
     modelParameter.IsAutoSendSMSByMemRegister          = this.ckbIsAutoSendSMSByMemRegister.Checked;
     modelParameter.IsAutoSendMMSByMemRegister          = this.ckbIsAutoSendMMSByMemRegister.Checked;
     modelParameter.IsAutoSendSMSByMemRecharge          = this.ckbIsAutoSendSMSByMemRecharge.Checked;
     modelParameter.IsAutoSendSMSByMemWithdraw          = this.ckbIsAutoSendSMSByMemWithdraw.Checked;
     modelParameter.IsAutoSendSMSByMemGiftExchange      = this.ckbIsAutoSendSMSByMemGiftExchange.Checked;
     modelParameter.IsAutoSendSMSByMemPointChange       = this.ckbIsAutoSendSMSByMemPointChange.Checked;
     modelParameter.IsAutoSendSMSByCommodityConsumption = this.ckbIsAutoSendSMSByCommodityConsumption.Checked;
     modelParameter.IsAutoSendSMSByFastConsumption      = this.ckbIsAutoSendSMSByFastConsumption.Checked;
     modelParameter.IsAutoSendSMSByMemRedTimes          = this.ckbIsAutoSendSMSByMemRedTimes.Checked;
     modelParameter.IsAutoSendSMSByTimingConsumption    = this.ckbIsAutoSendSMSByTimingConsumption.Checked;
     modelParameter.IsAutoSendSMSByStorageTiming        = this.ckbIsAutoSendSMSByStorageTiming.Checked;
     modelParameter.MarketingSMS          = this.chkMarketingSMS.Checked;
     modelParameter.MarketingSmsSeries    = this.txtMarketingSMS.Text.Trim();
     modelParameter.MarketingSmsSerialPwd = ((this.txtMarketingSMSPwd.Text.Trim() == "") ? this.curParameter.strMarketingSmsSerialPwd : this.txtMarketingSMSPwd.Text.Trim());
     Chain.BLL.SysParameter bllUpdateParameter = new Chain.BLL.SysParameter();
     if (bllUpdateParameter.UpdateExtraParameter(modelParameter))
     {
         PubFunction pub = new PubFunction();
         PubFunction.curParameter = pub.LoadSysParameter();
         this.curParameter        = PubFunction.curParameter;
         PubFunction.SaveSysLog(this._UserID, 3, "增值服务-参数设置", "增值服务的参数设置成功", this._UserShopID, DateTime.Now, PubFunction.ipAdress);
         base.OutputWarn("保存成功!");
     }
     else
     {
         base.OutputWarn("系统异常,未保存数据,请再次点击保存!");
     }
 }
Esempio n. 3
0
        protected void btnSysParameter_Click(object sender, EventArgs e)
        {
            string pointnum = "";

            pointnum = pointnum + this.Txthycz.Text + "$";
            pointnum = pointnum + this.Txtjfbd.Text + "$";
            pointnum = pointnum + this.Txtjfdh.Text + "$";
            pointnum = pointnum + this.Txtsprk.Text + "$";
            pointnum = pointnum + this.Txtspxf.Text + "$";
            pointnum = pointnum + this.Txtjcxf.Text + "$";
            pointnum = pointnum + this.Txtksxf.Text + "$";
            pointnum = pointnum + this.Txthycc.Text + "$";
            pointnum = pointnum + this.Txthycs.Text + "$";
            pointnum = pointnum + this.Txtxfjl.Text + "$";
            pointnum = pointnum + this.Txthyczbb.Text + "$";
            pointnum = pointnum + this.Txtjfbdbb.Text + "$";
            pointnum = pointnum + this.Txtjfdhbb.Text + "$";
            pointnum = pointnum + this.Txtckrkmx.Text + "$";
            pointnum = pointnum + this.AccountsToMoney.Text + "$";
            Chain.BLL.SysParameter   bllUpdateParameter = new Chain.BLL.SysParameter();
            Chain.Model.SysParameter modelParameter     = bllUpdateParameter.GetModel(1);
            modelParameter.ParameterID      = 1;
            modelParameter.Pwd              = this.chkPwd.Checked;
            modelParameter.RegNullPwd       = this.ckbRegNullPwd.Checked;
            modelParameter.MoneyAndPoint    = this.chkMoneyAndPoint.Checked;
            modelParameter.AutoLevel        = this.chkAutoLevel.Checked;
            modelParameter.DegradeLevel     = this.chkDegradeLevel.Checked;
            modelParameter.GiveMemMoneyRate = decimal.Parse(this.txtGiveMemMoneyRate.Text);
            modelParameter.PastTime         = this.chkPastTime.Checked;
            string  strRecommendPoint   = this.txtRecommendPoint.Text.Trim();
            decimal dclDrawMoneyPercent = 0m;
            int     result = 0;

            if (!int.TryParse(this.txtStockCount.Text.Trim(), out result))
            {
                base.OutputWarn("库存报警数量只能输入正整数!");
            }
            else if (!int.TryParse(this.txtPointPeriod.Text.Trim(), out result))
            {
                base.OutputWarn("积分到期清零周期只能输入正整数!");
            }
            else if (!decimal.TryParse(this.txtDrawMoneyPercent.Text.Trim(), out dclDrawMoneyPercent))
            {
                base.OutputWarn("账户提现折损率的取值范围只能是0至1之间的数字!");
            }
            else
            {
                Regex regex = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$");
                if (this.txtEmailAdress.Text != "" && !regex.IsMatch(this.txtEmailAdress.Text))
                {
                    if (this.chkEmail.Checked)
                    {
                        base.OutputWarn("邮箱格式不正确,请重新输入!");
                        return;
                    }
                    this.txtEmailAdress.Text = "";
                }
                if (this.txtEmailAdress.Text != "" && (this.txtEmailPwd.Text == "" || this.txtEmailSMTP.Text == "" || this.txtEnterpriseEmailPort.Text == ""))
                {
                    if (this.chkEmail.Checked)
                    {
                        base.OutputWarn("邮箱账号已经输入,请完善邮箱设置!");
                        return;
                    }
                }
                if (!int.TryParse(this.txtEnterpriseEmailPort.Text.Trim(), out result))
                {
                    if (this.chkEmail.Checked)
                    {
                        base.OutputWarn("邮件端口只能输入正整数!");
                        return;
                    }
                    this.txtEnterpriseEmailPort.Text = "25";
                }
                if (dclDrawMoneyPercent <= 0m || dclDrawMoneyPercent > 1m)
                {
                    base.OutputWarn("账户提现折损率的取值范围只能是0至1之间的数字!");
                }
                else if (!this.chkPayCard.Checked && (!this.chkPayCash.Checked & !this.chkPayBink.Checked & !this.chkPayCoupon.Checked))
                {
                    base.OutputWarn("*必须选择付费方式,否则无法结算!");
                }
                else
                {
                    modelParameter.DrawMoneyPercent      = dclDrawMoneyPercent;
                    modelParameter.RecommendPoint        = ((strRecommendPoint != "") ? int.Parse(strRecommendPoint) : 0);
                    modelParameter.PointPeriod           = Convert.ToInt32(this.txtPointPeriod.Text);
                    modelParameter.StockCount            = Convert.ToInt32(this.txtStockCount.Text);
                    modelParameter.ExpensePrefix         = this.txtExpensePrefix.Text;
                    modelParameter.GoodsExpensePrefix    = this.txtGoodsExpensePrefix.Text;
                    modelParameter.TimeExpensePrefix     = this.txtTimeExpensePrefix.Text;
                    modelParameter.MemCountPrefix        = this.txtMemCountPrefix.Text;
                    modelParameter.MemRechargePrefix     = this.txtMemRechargePrefix.Text;
                    modelParameter.GoodsInPrefix         = this.txtGoodsInPrefix.Text;
                    modelParameter.GoodsAllotPrefix      = this.txtGoodsAllotPrefix.Text;
                    modelParameter.MemDrawMoneyPrefix    = this.txtMemDrawMoneyPrefix.Text;
                    modelParameter.MemPointChangePrefix  = this.txtMemPointChangePrefix.Text;
                    modelParameter.GiftExchangePrefix    = this.txtGiftExchangePrefix.Text;
                    modelParameter.AllianceRebatePercent = decimal.Parse(this.txtAllianceRebatePercent.Text);
                    modelParameter.CardShopRebatePercent = decimal.Parse(this.txtCardShopRebatePercent.Text);
                    modelParameter.PointDrawPercent      = decimal.Parse(this.txtPointDrawPercent.Text);
                    modelParameter.Senseiccard           = this.chkSenseiccard.Checked;
                    modelParameter.Contacticcard         = this.chkContacticcard.Checked;
                    modelParameter.PointNumStr           = pointnum;
                    if (this.PrintPreview.Checked)
                    {
                        modelParameter.PrintPreview = 1;
                    }
                    else
                    {
                        modelParameter.PrintPreview = 0;
                    }
                    if (this.A4ShiZhi.Checked)
                    {
                        modelParameter.PrintPaperType = 0;
                    }
                    if (this.SanLianShiZhi.Checked)
                    {
                        modelParameter.PrintPaperType = 1;
                    }
                    if (this.POs58ShiZhi.Checked)
                    {
                        modelParameter.PrintPaperType = 2;
                    }
                    if (this.POs80ShiZhi.Checked)
                    {
                        modelParameter.PrintPaperType = 3;
                    }
                    if (this.CKautoBackup.Checked)
                    {
                        modelParameter.AutoBackupDB = true;
                    }
                    else
                    {
                        modelParameter.AutoBackupDB = false;
                    }
                    modelParameter.AutoBackupDay                        = Convert.ToInt32(this.TBautoBackupDay.Text);
                    modelParameter.IsPayCard                            = this.chkPayCard.Checked;
                    modelParameter.IsPayCash                            = this.chkPayCash.Checked;
                    modelParameter.IsPayBink                            = this.chkPayBink.Checked;
                    modelParameter.IsPayCoupon                          = this.chkPayCoupon.Checked;
                    modelParameter.IsPayPoint                           = this.chkPayPoint.Checked;
                    modelParameter.AutoPrint                            = this.chkAutoPrint.Checked;
                    modelParameter.AccordPrint                          = this.chkAccordPrint.Checked;
                    modelParameter.PrintTitle                           = this.txtPrintTitle.Text;
                    modelParameter.PrintFootNote                        = this.txtPrintFootNote.Text;
                    modelParameter.IsStaff                              = this.chkStaff.Checked;
                    modelParameter.IsEmail                              = this.chkEmail.Checked;
                    modelParameter.IsEmailNotice                        = this.chkMoneyEmail.Checked;
                    modelParameter.EmailAdress                          = this.txtEmailAdress.Text;
                    modelParameter.EmailPwd                             = this.txtEmailPwd.Text;
                    modelParameter.EmailSMTP                            = this.txtEmailSMTP.Text;
                    modelParameter.EnterpriseEmailPort                  = int.Parse(this.txtEnterpriseEmailPort.Text);
                    modelParameter.EnterpriseEmailEnableSSL             = this.chkEnterpriseEmailEnableSSL.Checked;
                    modelParameter.EnterpriseEmailUseDefaultCredentials = this.chkEnterpriseEmailUseDefaultCredentials.Checked;
                    modelParameter.EnterpriseEmailDisplayName           = this.txtEnterpriseEmailDisplayName.Text;
                    modelParameter.IsMustSlotCard                       = this.chkIsMustSlotCard.Checked;
                    modelParameter.UnitList                             = ((this.txtUnitList.Text == "") ? "个" : this.txtUnitList.Text);
                    if (this.chkStaff.Checked)
                    {
                        modelParameter.StaffType = this.rdStaff.Checked;
                    }
                    modelParameter.PointLevel               = this.chkPointLevel.Checked;
                    modelParameter.SellerAccount            = this.txtSellerAccount.Text;
                    modelParameter.PartnerID                = this.txtPartnerID.Text;
                    modelParameter.PartnerKey               = this.txtPartnerKey.Text;
                    modelParameter.IsEditPwdNeedOldPwd      = this.chkIsNeedPwd.Checked;
                    modelParameter.IsMemRegisterStaff       = this.chkMemRegisterStaff.Checked;
                    modelParameter.StorageTimingPrefix      = this.txtStorageTimingPrefix.Text.Trim();
                    modelParameter.MemCountExpensePrefix    = this.txtMemCountExpensePrefix.Text.Trim();
                    modelParameter.IsAutoSendSMSByMemPast   = this.chkIsAutoSendSMSByMemPast.Checked;
                    this.txtAutoSendSMSByMemPastForDay.Text = ((this.txtAutoSendSMSByMemPastForDay.Text.Trim() == "") ? "0" : this.txtAutoSendSMSByMemPastForDay.Text);
                    if (modelParameter.IsAutoSendSMSByMemPast)
                    {
                        if (!int.TryParse(this.txtAutoSendSMSByMemPastForDay.Text.Trim(), out result) || Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim()) < 0 || Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim()) > 30)
                        {
                            base.OutputWarn("会员到期提醒提前天数只能是0到30之间的正整数!");
                            return;
                        }
                        modelParameter.AutoSendSMSByMemPastForDay = Convert.ToInt32(this.txtAutoSendSMSByMemPastForDay.Text.Trim());
                    }
                    else
                    {
                        modelParameter.AutoSendSMSByMemPastForDay = 0;
                    }
                    modelParameter.IsAutoSendSMSByMemBirthday   = this.chksAutoSendSMSByMemBirthday.Checked;
                    this.txtAutoSendSMSByMemBirthdayForDay.Text = ((this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim() == "") ? "0" : this.txtAutoSendSMSByMemBirthdayForDay.Text);
                    if (modelParameter.IsAutoSendSMSByMemBirthday)
                    {
                        if (!int.TryParse(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim(), out result) || Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim()) < 0 || Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim()) > 30)
                        {
                            base.OutputWarn("会员生日提醒提前天数只能是0到30之间的正整数!");
                            return;
                        }
                        modelParameter.AutoSendSMSByMemBirthdayForDay = Convert.ToInt32(this.txtAutoSendSMSByMemBirthdayForDay.Text.Trim());
                    }
                    else
                    {
                        modelParameter.AutoSendSMSByMemBirthdayForDay = 0;
                    }
                    modelParameter.IsStartWeiXin        = this.chkIsStartWeiXin.Checked;
                    modelParameter.IsStartTimingProject = this.chkIsStartTimingProject.Checked;
                    modelParameter.IsStartMemCount      = this.chkIsStartMemCount.Checked;
                    modelParameter.EmailUserName        = this.txtEmailUserName.Text;
                    modelParameter.PointUsePercent      = decimal.Parse(this.txtPointUsePercent.Text);
                    modelParameter.PointDiscountPercent = decimal.Parse(this.txtPointDiscountPercent.Text);
                    modelParameter.IsSendCard           = this.chkIsSendCard.Checked;
                    modelParameter.ShopSmsManage        = this.chkShopSmsManage.Checked;
                    modelParameter.ShopPointManage      = this.chkShopPointManage.Checked;
                    modelParameter.ShopSettlement       = this.chkIsSettlement.Checked;
                    if (!PubFunction.curParameter.EnableGoods)
                    {
                        modelParameter.IsStartTimingProject = (modelParameter.IsStartMemCount = false);
                    }
                    if (!this.SwitchingMode(modelParameter))
                    {
                        base.OutputWarn("保存失败!");
                    }
                    else
                    {
                        List <Chain.Model.SysGroup> list = new Chain.BLL.SysGroup().GetModelList("");
                        foreach (Chain.Model.SysGroup item in list)
                        {
                            PubFunction.UpdateGroupAuthority(item.GroupID);
                        }
                        if (bllUpdateParameter.Update(modelParameter))
                        {
                            PubFunction pub = new PubFunction();
                            PubFunction.curParameter = pub.LoadSysParameter();
                            this.curParameter        = PubFunction.curParameter;
                            PubFunction.SaveSysLog(this._UserID, 3, "系统参数设置", "系统参数设置", this._UserShopID, DateTime.Now, PubFunction.ipAdress);
                            base.OutputWarn("保存成功!");
                        }
                        else
                        {
                            base.OutputWarn("系统异常,未保存数据,请再次点击保存!");
                        }
                    }
                }
            }
        }