public ActionResult Save_PromptLanguage(Guid id, string type, string content)
        {
            OfficialAccount_BLL bll = new OfficialAccount_BLL();
            OfficialAccount     of  = bll.Get(a => a.AccountID == id);

            try
            {
                //Regex.Replace(content, "<p>[\s]*</p>", "");
                content = Regex.Replace(content, "<p[^>]*>", "").Replace("</p>", "").Replace("<br>", "\n").Replace("<br/>", "\n");
                //content.Replace(@"<p>", "");
                //content.Replace(@"</p>", "");

                if (type == "welcome")
                {
                    of.SubscribeWelcome = content;
                    bll.Update(of);
                }
                else if (type == "rewelcome")
                {
                    of.ReSubscribeWelcome = content;
                    bll.Update(of);
                }
                else if (type == "sign")
                {
                    of.SignLanguage = content;
                    bll.Update(of);
                }

                return(Content("修改成功!"));
            }
            catch (Exception)
            {
                return(Content("修改失败!"));
            }
        }
        public ActionResult Edit_Area(OfficialAccount_AreaLimit_ViewModel model)
        {
            OfficialAccount_BLL bll      = new OfficialAccount_BLL();
            OfficialAccount     newmodel = bll.Get(a => a.AccountID == model.AccountID);

            newmodel.AreaLevel = model.AreaLevel;
            newmodel.AreaLimit = model.AreaLimit;



            if (bll.Update(newmodel) > 0)
            {
                return(RedirectToAction("Edit_Area"));
            }
            else
            {
                List <object> levelList = new List <object>
                {
                    new { Value = "国家", Text = "国家" },
                    new { Value = "省份", Text = "省份" },
                    new { Value = "城市", Text = "城市" }
                };
                ViewBag.LevelList = new SelectList(levelList, "Value", "Text", false);


                ModelState.AddModelError("", "修改失败,请稍后再试!");

                return(View(model));
            }
        }
        public ActionResult Edit_YouZan(OfficialAccount_YouZan_ViewModel model)
        {
            OfficialAccount_BLL bll      = new OfficialAccount_BLL();
            OfficialAccount     newmodel = bll.Get(a => a.AccountID == model.AccountID);

            newmodel.YouZanIsConfig        = true;
            newmodel.YouZanAppID           = model.YouZanAppID;
            newmodel.YouZanAppSecret       = model.YouZanAppSecret;
            newmodel.YZIncomeFirstPercent  = model.YZIncomeFirstPercent;
            newmodel.YZIncomeSecondPercent = model.YZIncomeSecondPercent;
            newmodel.YZIncomeCashLimit     = model.YZIncomeCashLimit;
            newmodel.YouZanEnable          = model.YouZanEnable;



            if (bll.Update(newmodel) > 0)
            {
                return(RedirectToAction("Edit_YouZan"));
            }
            else
            {
                ModelState.AddModelError("", "修改失败,请稍后再试!");

                return(View(model));
            }
        }
        public ActionResult _Configure(Guid AccountID)
        {
            OfficialAccount_BLL bll = new OfficialAccount_BLL();
            OfficialAccount     off = bll.Get(a => a.AccountID == AccountID);

            off.IsConfigure = true;
            bll.Update(off);
            return(PartialView(off));
        }
        public ActionResult Edit(OfficialAccount_ViewModel model)
        {
            AutoMapper.Mapper.CreateMap <OfficialAccount_ViewModel, OfficialAccount>();
            OfficialAccount newmodel = AutoMapper.Mapper.Map <OfficialAccount>(model);

            OfficialAccount_BLL bll = new OfficialAccount_BLL();

            if (bll.Update(newmodel) > 0)
            {
                return(RedirectToAction("MyList"));
            }
            else
            {
                ModelState.AddModelError("", "修改失败,请稍后再试!");

                return(View(model));
            }
        }
        public ActionResult Edit_BaseInfo(OfficialAccount_BaseInfo_ViewModel model)
        {
            OfficialAccount_BLL bll      = new OfficialAccount_BLL();
            OfficialAccount     newmodel = bll.Get(a => a.AccountID == model.AccountID);

            newmodel.WeiXinName   = model.WeiXinName;
            newmodel.OriginalID   = model.OriginalID;
            newmodel.WeiXinNumber = model.WeiXinNumber;
            newmodel.WeiXinName   = model.AppID;
            newmodel.WeiXinName   = model.AppSecret;


            if (bll.Update(newmodel) > 0)
            {
                return(RedirectToAction("Edit_BaseInfo"));
            }
            else
            {
                ModelState.AddModelError("", "修改失败,请稍后再试!");

                return(View(model));
            }
        }
        public ActionResult Edit_Score(OfficialAccount_Score_ViewModel model)
        {
            OfficialAccount_BLL bll      = new OfficialAccount_BLL();
            OfficialAccount     newmodel = bll.Get(a => a.AccountID == model.AccountID);

            newmodel.SubscribeAddScore            = model.SubscribeAddScore;
            newmodel.UnSubscribeReduceScore       = model.UnSubscribeReduceScore;
            newmodel.SubscribeParentAddScore      = model.SubscribeParentAddScore;
            newmodel.UnSubscribeParentReduceScore = model.UnSubscribeParentReduceScore;
            newmodel.SignAddScore = model.SignAddScore;



            if (bll.Update(newmodel) > 0)
            {
                return(RedirectToAction("Edit_Score"));
            }
            else
            {
                ModelState.AddModelError("", "修改失败,请稍后再试!");

                return(View(model));
            }
        }