public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } categoryID = TranslateUtils.ToInt(Request.QueryString["categoryID"]); if (!string.IsNullOrEmpty(Request.QueryString["Delete"]) && !string.IsNullOrEmpty(Request.QueryString["CategoryIDCollection"])) { var categoryIDArrayList = TranslateUtils.StringCollectionToIntArrayList(Request.QueryString["CategoryIDCollection"]); foreach (int theCategoryID in categoryIDArrayList) { DataProviderWX.StoreCategoryDAO.Delete(PublishmentSystemID, theCategoryID); } SuccessMessage("成功删除所选区域"); } else if (!string.IsNullOrEmpty(Request.QueryString["Subtract"]) || !string.IsNullOrEmpty(Request.QueryString["Add"])) { var isSubtract = (!string.IsNullOrEmpty(Request.QueryString["Subtract"])) ? true : false; DataProviderWX.StoreCategoryDAO.UpdateTaxis(PublishmentSystemID, categoryID, isSubtract); PageUtils.Redirect(GetRedirectUrl(PublishmentSystemID, categoryID)); return; } BindGrid(); if (!IsPostBack) { BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_Store, "门店属性管理", AppManager.WeiXin.Permission.WebSite.Store); RegisterClientScriptBlock("NodeTreeScript", CategoryTreeItem.GetScript(PublishmentSystemID, ECategoryLoadingType.Category, null)); if (categoryID > 0) { var onLoadScript = GetScriptOnLoad(); if (!string.IsNullOrEmpty(onLoadScript)) { Page.RegisterClientScriptBlock("NodeTreeScriptOnLoad", onLoadScript); } } var arguments = new NameValueCollection(); var showPopWinString = string.Empty; btnAdd.Attributes.Add("onclick", Modal.StoreCategoryAdd.GetOpenWindowStringToAdd(PublishmentSystemID)); btnDelete.Attributes.Add("onclick", JsUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUtils.GetWXUrl("background_storeCategory.aspx?Delete=True&publishmentSystemID=" + PublishmentSystemID), "CategoryIDCollection", "CategoryIDCollection", "请选择需要删除的门店属性!", "此操作将删除所选门店属性,确认删除吗?")); } }
public string GetLoadingCategorys(int parentID, string loadingType, string additional) { var arraylist = new ArrayList(); var eLoadingType = ECategoryLoadingTypeUtils.GetEnumType(loadingType); var categoryIDList = DataProviderWX.StoreCategoryDAO.GetCategoryIDListByParentID(PublishmentSystemID, parentID); var nameValueCollection = TranslateUtils.ToNameValueCollection(RuntimeUtils.DecryptStringByTranslate(additional)); var allCategoryIDArrayList = new ArrayList(); if (!string.IsNullOrEmpty(nameValueCollection["CategoryIDCollection"])) { allCategoryIDArrayList = TranslateUtils.StringCollectionToIntArrayList(nameValueCollection["CategoryIDCollection"]); nameValueCollection.Remove("CategoryIDCollection"); foreach (var categotyID in categoryIDList) { var categoryInfo = DataProviderWX.StoreCategoryDAO.GetCategoryInfo(categotyID); if (categoryInfo.ParentID != 0 || allCategoryIDArrayList.Contains(categotyID)) { arraylist.Add(BackgroundStoreCategory.GetCategoryRowHtml(PublishmentSystemID, categoryInfo, eLoadingType, nameValueCollection)); } } } else { foreach (var categotyID in categoryIDList) { var categoryInfo = DataProviderWX.StoreCategoryDAO.GetCategoryInfo(categotyID); arraylist.Add(BackgroundStoreCategory.GetCategoryRowHtml(PublishmentSystemID, categoryInfo, eLoadingType, nameValueCollection)); } } var builder = new StringBuilder(); foreach (string html in arraylist) { builder.Append(html); } return(builder.ToString()); }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (!string.IsNullOrEmpty(Request.QueryString["Delete"])) { var list = TranslateUtils.StringCollectionToIntArrayList(Request.QueryString["IDCollection"]); if (list.Count > 0) { try { //BaiRongDataProvider.UserCreditsLogDao.Delete(list); SuccessMessage("积分记录删除成功!"); } catch (Exception ex) { FailMessage(ex, "积分记录删除失败!"); } } } var userNameArrayList = BaiRongDataProvider.UserDao.GetUserNameArrayList(Request.QueryString["mobile"], 0, 0, true); var theUserNameArrayList = DataProviderWX.CardSNDAO.GetUserNameArrayList(PublishmentSystemID, TranslateUtils.ToInt(Request.QueryString["cardID"]), Request.QueryString["cardSN"], Request.QueryString["userName"]); if (userNameArrayList.Count > 0) { if (theUserNameArrayList.Count <= 0) { if (!string.IsNullOrEmpty(Request.QueryString["mobile"])) { theUserNameArrayList = userNameArrayList; } } else { foreach (string userName in userNameArrayList) { if (!string.IsNullOrEmpty(Request.QueryString["mobile"])) { if (string.IsNullOrEmpty(Request.QueryString["cardSN"]) && string.IsNullOrEmpty(Request.QueryString["userName"])) { theUserNameArrayList = userNameArrayList; } else { if (!theUserNameArrayList.Contains(userName)) { theUserNameArrayList.Add(userName); } } } } } } spContents.ControlToPaginate = rptContents; spContents.ItemsPerPage = 20; spContents.ConnectionString = BaiRongDataProvider.ConnectionString; //spContents.SelectCommand = BaiRongDataProvider.UserCreditsLogDao.GetSqlString(AppManager.WeiXin.AppID, theUserNameArrayList); spContents.SortField = "AddDate"; spContents.SortMode = SortMode.DESC; rptContents.ItemDataBound += new RepeaterItemEventHandler(rptContents_ItemDataBound); if (!IsPostBack) { BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_Card, "会员积分管理", AppManager.WeiXin.Permission.WebSite.Card); var cardInfoList = DataProviderWX.CardDAO.GetCardInfoList(PublishmentSystemID); foreach (var cardInfo in cardInfoList) { ddlCard.Items.Add(new ListItem(cardInfo.CardTitle, cardInfo.ID.ToString())); } spContents.DataBind(); ddlCard.SelectedValue = Request.QueryString["cardID"]; tbCardSN.Text = Request.QueryString["cardSN"]; tbUserName.Text = Request.QueryString["userName"]; tbMobile.Text = Request.QueryString["mobile"]; var urlDelete = PageUtils.AddQueryString(GetRedirectUrl(PublishmentSystemID, tbCardSN.Text, tbUserName.Text, tbMobile.Text), "Delete", "True"); btnDelete.Attributes.Add("onclick", JsUtils.GetRedirectStringWithCheckBoxValueAndAlert(urlDelete, "IDCollection", "IDCollection", "请选择需要删除的充值记录", "此操作将删除所选充值记录,确认吗?")); btnReturn.Attributes.Add("onclick", $@"location.href=""{BackgroundNavTransaction.GetRedirectUrl(PublishmentSystemID)}"";return false;"); } }