protected void btnModRegion_Click(object sender, EventArgs e) { string name = this.txtRegion.Text.Trim(); string cCh = txtC.Text.Trim(); if (name.Length == 0 || cCh.Length == 0) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('商圈名称和字符信息不能为空!');", true); return; } string hidValue = this.hidRegion.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; } AreaInfoService.Update(Convert.ToInt32(arr[0]), name, cCh); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('修改成功!');", true); this.GetRegion(this.ddlCity.SelectedValue); }
/// <summary> /// 修改一级信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnModOne_Click(object sender, EventArgs e) { string name = this.txtOne.Text.Trim(); string pChar = txtChar.Text.Trim(); if (name.Length == 0 || pChar.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; } AreaInfoService.Update(Convert.ToInt32(arr[0]), name, pChar); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('修改成功!');location.href='areaInfo.aspx'", true); }