public ActionResult UpdateAlipayBaoYangItem(int pkid)
        {
            var item  = AliPayBaoYangManage.GetAliPayBaoYangItem(pkid);
            var first = item.FirstOrDefault() != null?item.First() : new AliPayBaoYangItem();

            return(View(first));
        }
        // GET: AlipayBaoyangManage
        public ActionResult AlipayBaoyangItems()
        {
            AliPayBaoYangSetting setting = new AliPayBaoYangSetting();

            setting.Activity = AliPayBaoYangManage.GetAliPayBaoYangActivity();
            if (setting.Activity == null)
            {
                setting.Activity = new AliPayBaoYangActivity();
                var datetime = DateTime.Now;
                setting.Activity.BeginTime = Convert.ToDateTime(datetime.ToString("yyyy-MM-dd HH:mm:ss"));
                setting.Activity.EndTime   = Convert.ToDateTime(datetime.ToString("yyyy-MM-dd HH:mm:ss"));;
            }

            setting.Activity.BeginTime = Convert.ToDateTime(setting.Activity.BeginTime.ToString("yyyy-MM-dd HH:mm:ss"));
            setting.Activity.EndTime   = Convert.ToDateTime(setting.Activity.EndTime.ToString("yyyy-MM-dd HH:mm:ss"));
            setting.AliPayBaoYangItems = AliPayBaoYangManage.GetAliPayBaoYangItem(-1);
            return(View(setting));
        }
        public ActionResult AddAlipayBaoYangItem(AliPayBaoYangItem item)
        {
            bool flag = false;

            try
            {
                List <AliPayBaoYangItem> items = AliPayBaoYangManage.GetAliPayBaoYangItem(-1);
                if (items != null)
                {
                    if (!items.Where(q => q != null).Any(p => p.KeyWord.Equals(item.KeyWord, StringComparison.OrdinalIgnoreCase)))
                    {
                        AliPayBaoYangManage.SaveAliPayBaoYangItem(item);
                        flag = true;
                    }
                }
            }
            catch (Exception ex)
            {
                WebLog.LogException(ex);
            }
            return(Json(flag, JsonRequestBehavior.AllowGet));
        }