public JsonResult GetCustomerState() { EnumJson[] cState = EnumJson.Convert(typeof(Sintoacct.Progress.Models.CustomerState)); foreach (EnumJson s in cState) { if (s.Name == "Normal") { s.Name = "正常"; } if (s.Name == "Stopped") { s.Name = "欠费"; } if (s.Name == "Canceled") { s.Name = "已注销"; } if (s.Name == "Deleted") { s.Name = "已删除"; } if (s.Name == "LostContact") { s.Name = "已失联"; } if (s.Name == "Transferred") { s.Name = "已转走"; } } return(Json(cState, "text/html", JsonRequestBehavior.AllowGet)); }
public JsonResult GetWorkOrderPriority() { return(Json(EnumJson.Convert(typeof(Sintoacct.Progress.Models.WorkOrderPriority)), "text/html", JsonRequestBehavior.AllowGet)); }
public void ProcessRequest(HttpContext context) { string str = context.Request.Form["actionName"]; string s = string.Empty; switch (str) { case "Vote": s = JsonConvert.SerializeObject(StoreHelper.GetVoteList()); goto Label_0547; case "Category": s = JsonConvert.SerializeObject(from item in CatalogHelper.GetMainCategories() select new { CateId = item.CategoryId, CateName = item.Name }); goto Label_0547; case "Activity": { Array values = Enum.GetValues(typeof(LotteryActivityType)); List <EnumJson> list2 = new List <EnumJson>(); foreach (Enum enum2 in values) { EnumJson json = new EnumJson { Name = enum2.ToShowText(), Value = enum2.ToString() }; list2.Add(json); } s = JsonConvert.SerializeObject(list2); goto Label_0547; } case "ActivityList": { string str3 = context.Request.Form["acttype"]; LotteryActivityType type = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), str3); if (type == LotteryActivityType.SignUp) { s = JsonConvert.SerializeObject(from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name }); } goto Label_0547; } case "AccountTime": { s = s + "{"; BalanceDrawRequestQuery entity = new BalanceDrawRequestQuery { RequestTime = "", CheckTime = "", StoreName = "", PageIndex = 1, PageSize = 1, SortOrder = SortAction.Desc, SortBy = "RequestTime", RequestEndTime = "", RequestStartTime = "", IsCheck = "1", UserId = context.Request.Form["UserID"] }; Globals.EntityCoding(entity, true); DataTable data = (DataTable)DistributorsBrower.GetBalanceDrawRequest(entity, null).Data; if (data.Rows.Count <= 0) { s = s + "\"Time\":\"\""; break; } if (!(data.Rows[0]["MerchantCode"].ToString().Trim() != context.Request.Form["merchantcode"].Trim())) { s = s + "\"Time\":\"\""; break; } s = s + "\"Time\":\"" + data.Rows[0]["RequestTime"].ToString() + "\""; break; } case "ProdSelect": { SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); if (!string.IsNullOrEmpty(masterSettings.DistributorProducts)) { DataTable products = ProductHelper.GetProducts(masterSettings.DistributorProducts); if ((products != null) && (products.Rows.Count > 0)) { List <SelectProduct> list3 = new List <SelectProduct>(); foreach (DataRow row in products.Rows) { SelectProduct product = new SelectProduct { productid = row["productid"].ToString(), ProductName = row["ProductName"].ToString(), ThumbnailUrl60 = row["ThumbnailUrl60"].ToString() }; list3.Add(product); } s = JsonConvert.SerializeObject(list3); } } goto Label_0547; } case "ProdDel": { s = s + "{"; string str4 = context.Request.Form["productid"]; SiteSettings settings = SettingsManager.GetMasterSettings(false); if (!string.IsNullOrEmpty(settings.DistributorProducts) && settings.DistributorProducts.Contains(str4)) { string str5 = ""; foreach (string str6 in settings.DistributorProducts.Split(new char[] { ',' })) { if (!str6.Equals(str4)) { str5 = str5 + str6 + ","; } } if (str5.Length > 0) { str5 = str5.Substring(0, str5.Length - 1); } settings.DistributorProducts = str5; SettingsManager.Save(settings); } s = s + "\"status\":\"ok\"" + "}"; goto Label_0547; } default: goto Label_0547; } s = s + "}"; Label_0547: context.Response.Write(s); }
public void ProcessRequest(HttpContext context) { string str = context.Request.Form["actionName"]; string s = string.Empty; string str4 = str; if (str4 != null) { if (!(str4 == "Topic")) { if (str4 == "Vote") { s = JsonConvert.SerializeObject(StoreHelper.GetVoteList()); } else if (str4 == "Category") { s = JsonConvert.SerializeObject(from item in CatalogHelper.GetMainCategories() select new { CateId = item.CategoryId, CateName = item.Name }); } else if (str4 == "Activity") { Array values = Enum.GetValues(typeof(LotteryActivityType)); List <EnumJson> list3 = new List <EnumJson>(); foreach (Enum enum2 in values) { EnumJson json = new EnumJson { Name = enum2.ToShowText(), Value = enum2.ToString() }; list3.Add(json); } s = JsonConvert.SerializeObject(list3); } else if (str4 == "ActivityList") { string str3 = context.Request.Form["acttype"]; LotteryActivityType type = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), str3); if (type == LotteryActivityType.SignUp) { s = JsonConvert.SerializeObject(from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name }); } else { s = JsonConvert.SerializeObject(VShopHelper.GetLotteryActivityByType(type)); } } else if (str4 == "AccountTime") { s = s + "{"; BalanceDrawRequestQuery entity = new BalanceDrawRequestQuery { RequestTime = "", CheckTime = "", StoreName = "", PageIndex = 1, PageSize = 1, SortOrder = SortAction.Desc, SortBy = "RequestTime", RequestEndTime = "", RequestStartTime = "", IsCheck = "1", UserId = context.Request.Form["UserID"] }; Globals.EntityCoding(entity, true); DataTable data = (DataTable)DistributorsBrower.GetBalanceDrawRequest(entity).Data; if (data.Rows.Count > 0) { if (data.Rows[0]["MerchantCode"].ToString().Trim() != context.Request.Form["merchantcode"].Trim()) { s = s + "\"Time\":\"" + data.Rows[0]["RequestTime"].ToString() + "\""; } else { s = s + "\"Time\":\"\""; } } else { s = s + "\"Time\":\"\""; } s = s + "}"; } } else { s = JsonConvert.SerializeObject(VShopHelper.Gettopics()); } } context.Response.Write(s); }
public void ProcessRequest(HttpContext context) { string str = context.Request.Form["actionName"]; string s = string.Empty; string str4 = str; if (str4 != null) { if (!(str4 == "Topic")) { if (str4 == "Vote") { s = JsonConvert.SerializeObject(StoreHelper.GetVoteList()); } else if (str4 == "Category") { s = JsonConvert.SerializeObject(from item in CatalogHelper.GetMainCategories() select new { CateId = item.CategoryId, CateName = item.Name }); } else if (str4 == "Activity") { Array values = Enum.GetValues(typeof(LotteryActivityType)); List<EnumJson> list3 = new List<EnumJson>(); foreach (Enum enum2 in values) { EnumJson json = new EnumJson { Name = enum2.ToShowText(), Value = enum2.ToString() }; list3.Add(json); } s = JsonConvert.SerializeObject(list3); } else if (str4 == "ActivityList") { string str3 = context.Request.Form["acttype"]; LotteryActivityType type = (LotteryActivityType) Enum.Parse(typeof(LotteryActivityType), str3); if (type == LotteryActivityType.SignUp) { s = JsonConvert.SerializeObject(from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name }); } else { s = JsonConvert.SerializeObject(VShopHelper.GetLotteryActivityByType(type)); } } else if (str4 == "AccountTime") { s = s + "{"; BalanceDrawRequestQuery entity = new BalanceDrawRequestQuery { RequestTime = "", CheckTime = "", StoreName = "", PageIndex = 1, PageSize = 1, SortOrder = SortAction.Desc, SortBy = "RequestTime", RequestEndTime = "", RequestStartTime = "", IsCheck = "1", UserId = context.Request.Form["UserID"] }; Globals.EntityCoding(entity, true); DataTable data = (DataTable) DistributorsBrower.GetBalanceDrawRequest(entity).Data; if (data.Rows.Count > 0) { if (data.Rows[0]["MerchantCode"].ToString().Trim() != context.Request.Form["merchantcode"].Trim()) { s = s + "\"Time\":\"" + data.Rows[0]["RequestTime"].ToString() + "\""; } else { s = s + "\"Time\":\"\""; } } else { s = s + "\"Time\":\"\""; } s = s + "}"; } } else { s = JsonConvert.SerializeObject(VShopHelper.Gettopics()); } } context.Response.Write(s); }
public JsonResult GetCustomerLevel() { return(Json(EnumJson.Convert(typeof(Sintoacct.Progress.Models.CustomerLevel)), "text/html", JsonRequestBehavior.AllowGet)); }
public void ProcessRequest(HttpContext context) { string text = context.Request["actionName"]; string s = string.Empty; int num; switch (text) { case "Topic": { IList <TopicInfo> appTopics = VShopHelper.GetAppTopics(); s = JsonConvert.SerializeObject(appTopics); break; } case "Vote": { DataTable value4 = VshopBrowser.GetVoteByIsShowWX().Tables[0]; s = JsonConvert.SerializeObject(value4); break; } case "Category": { var value = from item in CatalogHelper.GetMainCategories() select new { CateId = item.CategoryId, CateName = item.Name }; s = JsonConvert.SerializeObject(value); break; } case "Activity": { string a = context.Request["client"].ToNullString().ToLower(); Array values = Enum.GetValues(typeof(LotteryActivityType)); if (a == "app") { values = Enum.GetValues(typeof(AppLotteryActivityType)); } List <EnumJson> list2 = new List <EnumJson>(); foreach (Enum item in values) { EnumJson enumJson3 = new EnumJson(); enumJson3.Name = item.ToShowText(); enumJson3.Value = item.ToString(); list2.Add(enumJson3); } s = JsonConvert.SerializeObject(list2); break; } case "ActivityList": { string value2 = context.Request.Form["acttype"]; LotteryActivityType lotteryActivityType = (LotteryActivityType)Enum.Parse(typeof(LotteryActivityType), value2); if (lotteryActivityType == LotteryActivityType.SignUp) { var value3 = from item in VShopHelper.GetAllActivity() select new { ActivityId = item.ActivityId, ActivityName = item.Name }; s = JsonConvert.SerializeObject(value3); } else { IList <LotteryActivityInfo> lotteryActivityByType = VShopHelper.GetLotteryActivityByType(lotteryActivityType); s = JsonConvert.SerializeObject(lotteryActivityByType); } break; } case "ArticleCategory": { IList <ArticleCategoryInfo> articleMainCategories = CommentBrowser.GetArticleMainCategories(); if (articleMainCategories != null && articleMainCategories.Count > 0) { List <EnumJson> list3 = new List <EnumJson>(); foreach (ArticleCategoryInfo item2 in articleMainCategories) { EnumJson enumJson4 = new EnumJson(); enumJson4.Name = item2.Name; EnumJson enumJson5 = enumJson4; num = item2.CategoryId; enumJson5.Value = num.ToString(); list3.Add(enumJson4); } s = JsonConvert.SerializeObject(list3); } break; } case "ArticleList": { int categoryId = 0; if (context.Request.Form["categoryId"] != null) { int.TryParse(context.Request.Form["categoryId"].ToString(), out categoryId); } IList <ArticleInfo> articleList = CommentBrowser.GetArticleList(categoryId, 1000); List <EnumJson> list = new List <EnumJson>(); foreach (ArticleInfo item3 in articleList) { EnumJson enumJson = new EnumJson(); enumJson.Name = item3.Title; EnumJson enumJson2 = enumJson; num = item3.ArticleId; enumJson2.Value = num.ToString(); list.Add(enumJson); } s = JsonConvert.SerializeObject(list); break; } } context.Response.Write(s); }