/// <summary> /// 列表顺序保存操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnSave_Click(object sender, EventArgs e) { int UpSum = 0; bool ReVal = true; foreach (RepeaterItem RptItem in this.rptMenuList.Items) { HiddenField txtClassId = (HiddenField)RptItem.FindControl("txtClassId"); TextBox txtOrder = (TextBox)RptItem.FindControl("txtOrder"); try { ReVal = tcbll.UpdateClassOrder(txtClassId.Value.Trim(), Convert.ToInt32(txtOrder.Text)); } catch { ReVal = false; } if (ReVal == false) { ++UpSum; } } if (UpSum == 0) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "ajaxjs", "alert('所有设定的栏目顺序都已保存成功!')", true); } else { Page.ClientScript.RegisterStartupScript(Page.GetType(), "ajaxjs", string.Format("alert('栏目顺序部份保存成功,共有{0}条记录保存失败!')", UpSum), true); } bind_tree("0"); BindData(); }
/// <summary> /// 列表顺序保存操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnSave_Click(object sender, EventArgs e) { int UpSum = 0; bool ReVal = true; foreach (RepeaterItem RptItem in this.rptMenuList.Items) { HiddenField txtClassId = (HiddenField)RptItem.FindControl("txtClassId"); TextBox txtOrder = (TextBox)RptItem.FindControl("txtOrder"); try { ReVal = new ROYcms.Sys.BLL.ROYcms_class().UpdateClassOrder(txtClassId.Value.Trim(), Convert.ToInt32(txtOrder.Text)); } catch { ReVal = false; ROYcms.Common.SystemCms.InsertErrLog("列表操作排序错误!", Request.PhysicalPath); } if (ReVal == false) { ++UpSum; } } if (UpSum == 0) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "ajaxjs", "alert('所有设定的栏目顺序都已保存成功!')", true); } else { Page.ClientScript.RegisterStartupScript(Page.GetType(), "ajaxjs", string.Format("alert('栏目顺序部份保存成功,共有{0}条记录保存失败!')", UpSum), true); } BindData(); }