//显示编辑 protected void Grid_BDOS_RowEditing(object sender, GridViewEditEventArgs e) { Panel_NewBDOS.Visible = false; UpdatePanel_NewBDOS.Update(); Grid_BDOS.EditIndex = e.NewEditIndex; string condition = GetCondition(); BindGrid_BDOS(condition); }
protected void Btn_NewBDOS_Click(object sender, EventArgs e) { Grid_BDOS.EditIndex = -1; Grid_BDOS.SelectedIndex = -1; BindGrid_BDOS(""); UpdatePanel1.Update(); Clear(); BindDropDownList2(); Panel_NewBDOS.Visible = true; UpdatePanel_NewBDOS.Update(); }
protected void Btn_ClearBDOS_Click(object sender, EventArgs e) { Grid_BDOS.EditIndex = -1; DropDownList1.Items.Insert(0, new ListItem("请选择", "")); BindDropDownList1(); TextBDOScode.Text = ""; BindGrid_BDOS(""); UpdatePanel_BDOS.Update(); Panel_NewBDOS.Visible = false; UpdatePanel_NewBDOS.Update(); }
protected void Btn_SearchBDOS_Click(object sender, EventArgs e) { Grid_BDOS.EditIndex = -1; string condition = GetCondition(); BindGrid_BDOS(condition); Panel_BDOS.Visible = true; UpdatePanel_BDOS.Update(); Panel_NewBDOS.Visible = false; UpdatePanel_NewBDOS.Update(); }
//Gridview删除 protected void Grid_BDOS_RowCommand(object sender, GridViewCommandEventArgs e) { Panel_NewBDOS.Visible = false; UpdatePanel_NewBDOS.Update(); if (e.CommandName == "Delete_BDOS") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_BDOS.SelectedIndex = row.RowIndex; string BDOS_Code = Convert.ToString(e.CommandArgument); basicCodeL.Delete_BDOrganization_depcode(BDOS_Code); BindGrid_BDOS(""); UpdatePanel_BDOS.Update(); } }
//新增确认 protected void BtnOK_NewBDOS_Click(object sender, EventArgs e) { if (DropDownList2.SelectedValue.ToString() == "" || newBDOScode.Text.ToString() == "" || TextBox4.Text.ToString() == "") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox4.Text.Length != 3) { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('必须为3位数!')", true); return; } string bDOS_Name = DropDownList2.SelectedValue.ToString(); string bDOS_DepCode = newBDOScode.Text.ToString(); string bDOS_No = TextBox4.Text.ToString().Trim(); basicCodeL.Insert_Update_BDOrganization_depcode(bDOS_Name, bDOS_DepCode, bDOS_No); BindGrid_BDOS(""); UpdatePanel_BDOS.Update(); Panel_NewBDOS.Visible = false; UpdatePanel_NewBDOS.Update(); }
//新增取消 protected void BtnCancel_NewBDOS_Click(object sender, EventArgs e) { Panel_NewBDOS.Visible = false; UpdatePanel_NewBDOS.Update(); }