Ejemplo n.º 1
0
 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("department_list", DTEnums.ActionEnum.Edit.ToString()); //检查权限
     BLL.department bll = new BLL.department();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存部门排序"); //记录日志
     JscriptMsg("保存排序成功!", "department_list.aspx", "Success");
 }