public ActionResult PosterBaseInfo() { List <BaseInfoModel> listbase = AdminBaseInfo.GetBaseInfoList(4); BaseInfoModel baseinfo = listbase[0]; return(View(baseinfo)); }
public ActionResult BaseInfoList(int baseid = -1) { List <BaseInfoModel> listbase = AdminBaseInfo.GetBaseInfoList(baseid); ShopUtils.SetAdminRefererCookie(Url.Action("baseinfolist")); return(View(listbase)); }
/// <summary> /// 修改基础类型 /// </summary> /// <param name="basetype"></param> /// <returns></returns> public ActionResult EditBaseType(int systypeid) { BaseTypeModel basetype = AdminBaseInfo.GetBaseTypeList(" where systypeid=" + systypeid)[0]; Load(basetype.Parentid == 0 ? basetype.Systypeid : basetype.Parentid); return(View(basetype)); }
/// <summary> /// 客服回复 /// </summary> /// <param name="outid"></param> /// <returns></returns> public ActionResult getkefuinfo(string outid = "-1") { outid = !string.IsNullOrEmpty(outid) ? outid : "-1"; BaseInfoModel info = new BaseInfoModel() { Outid = -1, Addtime = DateTime.Now, BaseId = 0, Content = "", Title = "异常报错" }; try { List <BaseInfoModel> infolist = AdminBaseInfo.GetBaseInfoList(-1, " and outid='" + outid + "' "); if (infolist.Count > 0) { info = infolist[0]; } } catch (Exception ex) { Console.Write(ex.ToString()); } StringBuilder strb = new StringBuilder(); strb.Append("callback({\"Outid\":\"" + info.Outid + "\",\"Title\":\"" + info.Title + "\",\"Content\":\"" + info.Content + "\"})"); return(Content(strb.ToString())); }
private void Load(int parentid = -1) { ShopUtils.SetAdminRefererCookie(string.Format("{0}/" + parentid, Url.Action("basetypelist"))); ViewData["baseTypeList"] = AdminBaseInfo.GetBaseTypeList(); ViewData["referer"] = ShopUtils.GetAdminRefererCookie(); }
public void LoadRoom() { List <SelectListItem> lotterylist = new List <SelectListItem>(); lotterylist.Add(new SelectListItem() { Text = "请选择", Value = "-1" }); foreach (BaseTypeModel info in AdminBaseInfo.GetBaseTypeList("where outtypeid=28")) { lotterylist.Add(new SelectListItem() { Text = info.Type, Value = info.Systypeid.ToString() }); } ViewData["Lotterytype"] = lotterylist; List <SelectListItem> roomlist = new List <SelectListItem>(); roomlist.Add(new SelectListItem() { Text = "请选择", Value = "-1" }); foreach (BaseTypeModel info in AdminBaseInfo.GetBaseTypeList("where parentid=19")) { roomlist.Add(new SelectListItem() { Text = info.Type, Value = info.Systypeid.ToString() }); } ViewData["Room"] = roomlist; }
/// <summary> /// 获取基础类型 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult BaseTypeDetails(int id) { List <BaseTypeModel> listbase = AdminBaseInfo.GetBaseTypeList(" where parentid=" + id); BaseTypeListModel basetypelist = new BaseTypeListModel() { basetypelist = listbase }; return(View(basetypelist)); }
/// <summary> /// 获取基础类型 /// </summary> /// <param name="condition"></param> /// <returns></returns> public ActionResult BaseTypeList(int id = -1) { string condition = ""; List <BaseTypeModel> listbase = AdminBaseInfo.GetBaseTypeList(condition); BaseTypeListModel basetypelist = new BaseTypeListModel() { basetypelist = listbase }; ViewData["parentid"] = id; return(View(basetypelist)); }
/// <summary> /// 获取基础类型 /// </summary> /// <param name="condition"></param> /// <returns></returns> public ActionResult BaseTypeList(int id = -1) { string condition = " where systypeid not in (1,5,10,11,19,23,29)"; List <BaseTypeModel> listbase = AdminBaseInfo.GetBaseTypeList(condition); BaseTypeListModel basetypelist = new BaseTypeListModel() { basetypelist = listbase }; ViewData["parentid"] = id; return(View(basetypelist)); }
public ActionResult EditBaseInfo(int baseid = -1) { List <BaseInfoModel> listbase = AdminBaseInfo.GetBaseInfoList(baseid); ViewData["referer"] = ShopUtils.GetAdminRefererCookie(); if (listbase.Count == 0) { return(View(new BaseInfoModel())); } BaseInfoModel baseinfo = listbase[0]; return(View(baseinfo)); }
public ActionResult EditBaseInfo(BaseInfoModel model) { ViewData["referer"] = ShopUtils.GetAdminRefererCookie(); bool result = AdminBaseInfo.UpdateBaseInfo(model.BaseId, model.Title, model.Content); if (result) { return(PromptView("保存成功")); } else { return(PromptView("保存失败")); } }
/// <summary> /// 获取银行卡类型 /// </summary> /// <returns></returns> public ActionResult Bank() { try { List <BaseTypeModel> list = AdminBaseInfo.GetBaseTypeList("where parentid=31"); JsonSerializerSettings jsetting = new JsonSerializerSettings(); jsetting.ContractResolver = new JsonLimitOutPut(new string[] { "Type" }, true); string data = JsonConvert.SerializeObject(list, jsetting).ToLower(); return(APIResult("success", data, true)); } catch (Exception ex) { return(APIResult("error", "获取失败")); } }
public ActionResult PosterBaseInfo(BaseInfoModel baseinfo) { List <BaseInfoModel> listbase = AdminBaseInfo.GetBaseInfoList(4); BaseInfoModel hbinfo = listbase[0]; hbinfo.Content = baseinfo.Content; bool result = AdminBaseInfo.UpdateBaseInfo(hbinfo.BaseId, hbinfo.Title, hbinfo.Content); if (result) { return(PromptView("保存成功")); } else { return(PromptView("保存失败")); } }
/// <summary> /// 删除基础类型 /// </summary> /// <param name="basetype"></param> /// <returns></returns> public ActionResult DeleteBaseType(int systypeid) { Load(systypeid); if (AdminBaseInfo.GetBaseTypeList(" where parentid=" + systypeid).Count > 0) { return(PromptView("删除失败,请删除此类型下的子类型")); } bool result = AdminBaseInfo.DeleteBaseType(systypeid); if (result) { return(PromptView("删除成功")); } else { return(PromptView("删除失败")); } }
///// <summary> ///// 提现条件 ///// </summary> ///// <returns></returns> //public ActionResult DrawSet() //{ //} #endregion #region 海报下载 public ActionResult hbdownload() { try { List <BaseInfoModel> infolist = AdminBaseInfo.GetBaseInfoList(4); if (infolist.Count == 0) { return(APIResult("error", "没有海报信息")); } BaseInfoModel binfo = AdminBaseInfo.GetBaseInfoList(4)[0]; string content = binfo.Content; string[] list = CommonHelper.GetHtmlImageUrlList(content); string img = list[0]; return(APIResult("success", BSPConfig.ShopConfig.SiteUrl + img)); } catch (Exception ex) { return(APIResult("error", "获取海报信息失败")); } }
/// <summary> /// 添加基础类型 /// </summary> /// <param name="basetype"></param> /// <returns></returns> public ActionResult AddBaseType(BaseTypeModel basetype, int parentid = -1) { if (AdminBaseInfo.GetBaseTypeByParentId(basetype.Parentid, basetype.Type)) { ModelState.AddModelError("Type", "名称已经存在"); } if (ModelState.IsValid) { bool result = AdminBaseInfo.AddBaseType(basetype); if (result) { return(PromptView("添加成功")); } else { return(PromptView("添加失败")); } } Load(basetype.Parentid); return(View(basetype)); }
/// <summary> /// 修改基础类型 /// </summary> /// <param name="basetype"></param> /// <returns></returns> public ActionResult EditBaseType(BaseTypeModel basetype) { if (AdminBaseInfo.GetBaseTypeByParentId(basetype.Parentid, basetype.Type, basetype.Systypeid)) { ModelState.AddModelError("Type", "名称已经存在"); } if (ModelState.IsValid) { bool result = AdminBaseInfo.UpdateBaseType(basetype); if (result) { return(PromptView("修改成功")); } else { return(PromptView("修改失败")); } } Load(basetype.Parentid == 0 ? basetype.Systypeid : basetype.Parentid); return(View(basetype)); }
public void Update(string name, DbCommand arg = null) { var value = Config.Admin.GetValue(name); base.ExecuteCommand(cmd => { string find = string.Format("Name = '{0}'", name); List <AdminBaseInfo> list = Find <AdminBaseInfo>(find, cmd); if (list.Count == 0) { AdminBaseInfo info = new AdminBaseInfo() { Name = name, Value = value.ToStrs(), DateTime = DateTime.Now }; Insert(info, cmd); } else { list[0].Value = value.ToStrs(); list[0].DateTime = DateTime.Now; Update(list[0], cmd); } }, arg); }
/// <summary> /// 帮助信息 /// </summary> /// <returns></returns> public ActionResult Help() { List <BaseInfoModel> listbase = AdminBaseInfo.GetBaseInfoList(-1, " and title='帮助信息'"); return(View(listbase)); }