public void Sort(HttpContext context) { int value = base.GetIntParam(context, "id", false).Value; int value2 = base.GetIntParam(context, "sort", false).Value; if (value < 1) { throw new HidistroAshxException("错误的参数"); } if (GalleryHelper.SwapSequence(value, value2)) { base.ReturnSuccessResult(context, "更新排序成功", 0, true); return; } throw new HidistroAshxException("操作失败"); }
protected void ImageTypeList_RowCommand(object sender, GridViewCommandEventArgs e) { int rowIndex = ((GridViewRow)((Control)e.CommandSource).NamingContainer).RowIndex; int num2 = (int)this.ImageTypeList.DataKeys[rowIndex].Value; if (e.CommandName == "Fall") { if (rowIndex < (this.ImageTypeList.Rows.Count - 1)) { GalleryHelper.SwapSequence(num2, (int)this.ImageTypeList.DataKeys[rowIndex + 1].Value); this.GetImageType(); } } else if ((e.CommandName == "Rise") && (rowIndex > 0)) { GalleryHelper.SwapSequence(num2, (int)this.ImageTypeList.DataKeys[rowIndex - 1].Value); this.GetImageType(); } }
protected void ImageTypeList_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { int rowIndex = ((System.Web.UI.WebControls.GridViewRow)((System.Web.UI.Control)e.CommandSource).NamingContainer).RowIndex; int categoryId = (int)this.ImageTypeList.DataKeys[rowIndex].Value; if (e.CommandName == "Fall") { if (rowIndex < this.ImageTypeList.Rows.Count - 1) { GalleryHelper.SwapSequence(categoryId, (int)this.ImageTypeList.DataKeys[rowIndex + 1].Value); this.GetImageType(); return; } } else if (e.CommandName == "Rise" && rowIndex > 0) { GalleryHelper.SwapSequence(categoryId, (int)this.ImageTypeList.DataKeys[rowIndex - 1].Value); this.GetImageType(); } }