public string Handler_ExistingUserRank() { StringBuilder sbRet = new StringBuilder(); ContentAPI apiContent = new ContentAPI(); Ektron.Cms.Content.EkContent brContent = new Ektron.Cms.Content.EkContent(apiContent.RequestInformationRef); int iRet = 0; long iUserRank = 0; int iPosts = 0; string sUserRank = ""; long iboard = 0; bool bisstart = false; UserRank[] aUserRank = (UserRank[]) Array.CreateInstance(typeof(Ektron.Cms.UserRank), 0); try { iUserRank = Convert.ToInt64(Request.QueryString["urid"]); sUserRank = Request.QueryString["urname"]; iboard = Convert.ToInt64(Request.QueryString["boardid"]); if (Request.QueryString["posts"] != "") { iPosts = Convert.ToInt32(Request.QueryString["posts"]); } if (Request.QueryString["isstart"] != "") { bisstart = Convert.ToBoolean(Request.QueryString["isstart"]); } aUserRank = brContent.SelectUserRankByBoard(iboard); if (aUserRank.Length > 0) { for (int i = 0; i <= (aUserRank.Length - 1); i++) { // check for existing name if (aUserRank[i].Name == sUserRank && !(iUserRank == aUserRank[i].ID)) { iRet = 2; // name conflict break; } // check for number of posts if (iPosts > 0) // if its not a ladder rank, we don't do this check { if (aUserRank[i].Posts > 0 && aUserRank[i].Posts == iPosts && !(iUserRank == aUserRank[i].ID)) { iRet = 1; // post conflict break; } } // check for starting rank if (bisstart == true && aUserRank[i].StartGroup == true && !(iUserRank == aUserRank[i].ID)) { iRet = 3; // start conflict break; } } } sbRet.Append(" <method>checkUserRank</method>").Append(Environment.NewLine); sbRet.Append(" <result>").Append(iRet.ToString()).Append("</result>").Append(Environment.NewLine); return sbRet.ToString(); } catch (Exception) { } return sbRet.ToString(); }
protected void Page_Load(object sender, System.EventArgs e) { _MessageHelper = _Common.EkMsgRef; AppImgPath = _Common.AppImgPath; AppPath = _Common.AppPath; this.MenuAppPath.Text = AppPath; _PageAction = Request.QueryString["action"]; object refCommon = _Common as object; mainTranslationPackageLink = "<a href =\"LocaleTaxonomy.aspx\">Translation Packages</a>"; Utilities.SetLanguage(_Common); RegisterResources(); _Content = _Common.EkContentRef; // TaxonomyLanguage = _Common.DefaultContentLanguage; TaxonomyLanguage = _Common.ContentLanguage; TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]); if ((Request.QueryString["view"] != null)) { _ViewItem = Request.QueryString["view"]; } taxonomy_request = new TaxonomyRequest(); taxonomy_request.TaxonomyId = TaxonomyId; taxonomy_request.TaxonomyLanguage = TaxonomyLanguage; taxonomy_request.PageSize = 99999999; // pagesize of 0 used to mean "all" TaxonomyBaseData[] taxcats = null; taxcats = _Content.ReadAllSubCategories(taxonomy_request); if ((taxcats != null)) { TaxonomyCategoryCount = taxcats.Length; } if ((Page.IsPostBack && !string.IsNullOrEmpty(Request.Form[isPostData.UniqueID]))) { if ((Request.Form["submittedaction"] == "delete")) { _Content.DeleteTaxonomy(taxonomy_request); //Response.Write("<script type=""text/javascript"">parent.CloseChildPage();</script>") Response.Redirect("LocaleTaxonomy.aspx?rf=1", false); } else if ((Request.Form["submittedaction"] == "deleteitem")) { taxonomy_request.TaxonomyIdList = Request.Form["selected_items"]; switch (_ViewItem.ToLower()) { case "cgroup": taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Group; break; case "user": taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User; break; case "locale": taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Locale; break; case "folder": taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.FolderDescendants; _Content.RemoveTaxonomyItem(taxonomy_request); taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.FolderChildren; break; default: taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Content; break; } _Content.RemoveTaxonomyItem(taxonomy_request); if ((Request.Params["ccp"] == null)) { Response.Redirect("LocaleTaxonomy.aspx?" + Request.ServerVariables["query_string"] + "&ccp=true", true); } else { Response.Redirect("LocaleTaxonomy.aspx?" + Request.ServerVariables["query_string"], true); } } } else if ((IsPostBack == false)) { DisplayPage(); } AssignTextStrings(); isPostData.Value = "true"; hdnSourceId.Value = TaxonomyId.ToString(); }