Ejemplo n.º 1
0
        private void Load(int parentid = -1)
        {
            ShopUtils.SetAdminRefererCookie(string.Format("{0}/" + parentid, Url.Action("basetypelist")));

            ViewData["baseTypeList"] = AdminBaseInfo.GetBaseTypeList();
            ViewData["referer"]      = ShopUtils.GetAdminRefererCookie();
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        /// <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));
        }
Ejemplo n.º 4
0
        /// <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));
        }
Ejemplo n.º 5
0
        /// <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));
        }
Ejemplo n.º 6
0
        /// <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));
        }
Ejemplo n.º 7
0
        /// <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", "获取失败"));
            }
        }
Ejemplo n.º 8
0
        /// <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("删除失败"));
            }
        }