/// <summary> /// 修改一级信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnModOne_Click(object sender, EventArgs e) { string name = this.txtOne.Text.Trim(); if (name.Length == 0) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('名称不能为空!');", true); return; } string hidValue = this.hidOne.Value.TrimEnd(','); if (hidValue.Length == 0) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('请选择要修改的信息!');", true); return; } string[] arr = hidValue.Split(','); if (arr.Length > 1) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('只能选择一项信息进行修改!');", true); return; } OALevelService.Update(Convert.ToInt32(arr[0]), name, ""); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('修改成功!');location.href='levelMenu.aspx'", true); }
/// <summary> /// 修改二级信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnModTwo_Click(object sender, EventArgs e) { string name = this.txtTwo.Text.Trim(); if (name.Length == 0) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('二级分类名称不能为空!');", true); return; } string hidValue = this.hidTwo.Value.TrimEnd(','); if (hidValue.Length == 0) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('请选择要修改的信息!');", true); return; } string[] arr = hidValue.Split(','); if (arr.Length > 1) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('只能选择一项信息进行修改!');", true); return; } string url = txtURL.Text.Trim(); OALevelService.Update(Convert.ToInt32(arr[0]), name, url); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('修改成功!');", true); GetTwo(this.ddlOne.SelectedValue); }