protected void BtnNew_Click(object sender, EventArgs e) { TxtAperson.Text = ""; TxtCperson.Text = ""; Panel_NewType.Visible = false; UpdatePanel_NewType.Update(); Panel_SearchEmployee.Visible = false; Panel_Grid_Detail.Visible = false; Panel_AddEmployee.Visible = false; UpdatePanel_SearchEmployee.Update(); UpdatePanel_Grid_Detail.Update(); UpdatePanel_AddEmployee.Update(); Panel_NewType.Visible = false; UpdatePanel_NewType.Update(); Panel2.Visible = false; Panel3.Visible = false; Panel4.Visible = false; UpdatePanel2.Update(); UpdatePanel3.Update(); UpdatePanel4.Update(); Panel_NewType.Visible = true; UpdatePanel_NewType.Update(); TxtNewType.Text = ""; Label28.Text = "新增"; }
protected void BtnCancel_Click(object sender, EventArgs e) { TxtAperson.Text = ""; TxtCperson.Text = ""; UpdatePanel_NewType.Update(); Panel_NewType.Visible = false; }
//显示编辑设备类型状态 protected void Grid_EquipType_RowEditing(object sender, GridViewEditEventArgs e) { Panel_NewType.Visible = false; UpdatePanel_NewType.Update(); Grid_EquipType.EditIndex = e.NewEditIndex; BindGrid_EquipType("and ETT_Type like '%" + Txtname.Text.ToString() + "%'"); }
}//重置 protected void GridView_SalaryItemAll_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { try { LbLblRecordSIT_ItemID2.Text = e.CommandArgument.ToString(); GridViewRow drv = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent)); int i = drv.RowIndex; if (flag == "考核人") { Label29.Text = GridView_Teacher.Rows[i].Cells[0].Text.ToString(); TxtAperson.Text = GridView_Teacher.Rows[i].Cells[1].Text.ToString(); } else { Label30.Text = GridView_Teacher.Rows[i].Cells[0].Text.ToString(); TxtCperson.Text = GridView_Teacher.Rows[i].Cells[1].Text.ToString(); } Panel4.Visible = false; UpdatePanel4.Update(); UpdatePanel_NewType.Update(); } catch (Exception) { throw; } } }//表中的选择
protected void Btn_Clear_Click(object sender, EventArgs e) { Grid_EquipType.EditIndex = -1; Txtname.Text = ""; UpdatePanel_Search.Update(); BindGrid_EquipType(""); UpdatePanel_TypeItem.Update(); Panel_NewType.Visible = false; UpdatePanel_NewType.Update(); }
protected void Btn_New_Click(object sender, EventArgs e) { Grid_EquipType.EditIndex = -1; Grid_EquipType.SelectedIndex = -1; BindGrid_EquipType(""); UpdatePanel_TypeItem.Update(); Clear(); Panel_NewType.Visible = true; UpdatePanel_NewType.Visible = true; UpdatePanel_NewType.Update(); }
protected void Btn_Search_Click(object sender, EventArgs e) { Grid_EquipType.EditIndex = -1; string condition = GetCondition(); Grid_EquipType.DataSource = equipTypeL.Search_EquipTypeTableInfo(condition); Grid_EquipType.DataBind(); UpdatePanel_TypeItem.Update(); Panel_NewType.Visible = false; UpdatePanel_NewType.Update(); }
//Gridview删除设备类型 protected void Grid_EquipType_RowCommand(object sender, GridViewCommandEventArgs e) { Panel_NewType.Visible = false; UpdatePanel_NewType.Update(); if (e.CommandName == "Delete_Type") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_EquipType.SelectedIndex = row.RowIndex; Guid ETT_ID = new Guid(Convert.ToString(e.CommandArgument)); equipTypeL.Delete_EquipTypeTableInfo(ETT_ID); BindGrid_EquipType(""); UpdatePanel_TypeItem.Update(); } }
protected void BtnSubmit_Click(object sender, EventArgs e) { if (Label28.Text == "新增") { hRPtypeInfo.HRPAT_ID = Guid.NewGuid(); if (TxtNewType.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入员工类型!')", true); return; } else if (TxtAperson.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入考核人!')", true); return; } else if (TxtAperson.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入考核人!')", true); return; } else { hRPtypeInfo.HRPAT_PType = TxtNewType.Text; hRPtypeInfo.HRPAT_APerson = Label29.Text.Trim(); hRPtypeInfo.HRPAT_CPerson = Label30.Text.Trim(); hRPtypeInfo.HRPAT_IsDeleted = false; try { int i = hRPerfL.Insert_HRPerformAssessType(hRPtypeInfo); //this.UpdatePanel_NewType.Update(); if (i <= 0) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('重复的员工类型!')", true); return; } else { BindGrid(LblStateForGrid_Type.Text); UpdatePanel_Grid.Update(); UpdatePanel_NewType.Update(); TxtNewType.Text = ""; Panel_NewType.Visible = false; BindGrid(""); //BindItem(""); ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('新增考核类型成功!')", true); } } catch (Exception ex) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('提交失败!" + ex + "')", true); } } } if (Label28.Text == "编辑") { hRPtypeInfo.HRPAT_ID = new Guid(Label27.Text); if (TxtNewType.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入员工类型!')", true); return; } else if (TxtAperson.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入考核人!')", true); return; } else if (TxtAperson.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入考核人!')", true); return; } else { hRPtypeInfo.HRPAT_PType = TxtNewType.Text; if (Label29.Text.Trim() == "") { Label29.Text = Label31.Text.Trim(); } if (Label30.Text.Trim() == "") { Label30.Text = Label32.Text.Trim(); } hRPtypeInfo.HRPAT_APerson = Label29.Text.Trim(); hRPtypeInfo.HRPAT_CPerson = Label30.Text.Trim(); try { int i = hRPerfL.Update_HRPerformAssessType_Person(hRPtypeInfo); if (i <= 0) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('更新失败!')", true); return; } else { BindGrid(LblStateForGrid_Type.Text); UpdatePanel_Grid.Update(); UpdatePanel_NewType.Update(); TxtNewType.Text = ""; Panel_NewType.Visible = false; BindGrid(""); ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('更新考核类型成功!')", true); } } catch (Exception ex) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('更新失败!" + ex + "')", true); } } } }
protected void Grid_Type_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete_Type") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_Type.SelectedIndex = row.RowIndex; Guid guid = new Guid(e.CommandArgument.ToString()); hRPerfL.Delete_HRPerformAssessType(guid); hRPItemL.Delete_HRPerformceItem(guid); BindGrid(""); //BindItem(""); } if (e.CommandName == "Delete_Type_Item") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_Type.SelectedIndex = row.RowIndex; Guid guid = new Guid(e.CommandArgument.ToString()); //hRPerfL.Delete_HRPerformAssessType(guid); hRPItemL.Delete_HRPerformceItem(guid); //BindGrid(""); BindItem(""); } if (e.CommandName == "Edit_Post") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Panel3.Visible = true; UpdatePanel3.Update(); LblState.Text = "编辑"; Label49.Text = e.CommandArgument.ToString(); id = new Guid(Label49.Text); HRPItemInfo hR = hRPItemL.SearchByID_HRPItem(id)[0]; TextBox_newItem1.Text = hR.HRPI_Items; TextBox_newItem2.Text = hR.HRPI_Contents; TextBox_newItem3.Text = hR.HRPI_StanScore; TextBox_newItem4.Text = hR.HRPI_AssStandard; TextBox_newItem5.Text = hR.HRPI_Remarks; UpdatePanel3.Update(); } if (e.CommandName == "Edit1") { Panel_NewType.Visible = false; UpdatePanel_NewType.Update(); Panel_SearchEmployee.Visible = false; Panel_Grid_Detail.Visible = false; Panel_AddEmployee.Visible = false; UpdatePanel_SearchEmployee.Update(); UpdatePanel_Grid_Detail.Update(); UpdatePanel_AddEmployee.Update(); GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_Type.SelectedIndex = row.RowIndex; Label48.Text = e.CommandArgument.ToString(); Guid guid = new Guid(Label48.Text); Panel2.Visible = true; UpdatePanel2.Update(); BindItem(""); } if (e.CommandName == "Edit2") { Panel_NewType.Visible = false; UpdatePanel_NewType.Update(); Panel2.Visible = false; Panel3.Visible = false; Panel4.Visible = false; UpdatePanel2.Update(); UpdatePanel3.Update(); UpdatePanel4.Update(); con1 = " and HRPAT_ID='" + e.CommandArgument.ToString() + "'"; GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_Type.SelectedIndex = row.RowIndex; Label50.Text = e.CommandArgument.ToString(); Guid guid = new Guid(Label50.Text); Panel_SearchEmployee.Visible = true; Panel_Grid_Detail.Visible = true; UpdatePanel_SearchEmployee.Update(); UpdatePanel_Grid_Detail.Update(); BindGridForEmployee(Grid_Detail, con1); Bind_DdlDep(DdlSearchDep); Bind_DdlPost(DdlSearchPost, ""); } if (e.CommandName == "Edit3") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Panel_NewType.Visible = true; UpdatePanel_NewType.Update(); Label28.Text = "编辑"; Label27.Text = e.CommandArgument.ToString(); id = new Guid(Label27.Text); HRPtypeInfo hRType = hRPerfL.SearchByID_HRPerformAssessType(id)[0]; DataSet dtAperson = neiaL.Search_ForTeacher_HRDDetail("and UMUI_UserID like '%" + hRType.HRPAT_APerson.Trim() + "%' "); DataSet dtCperson = neiaL.Search_ForTeacher_HRDDetail("and UMUI_UserID like '%" + hRType.HRPAT_CPerson.Trim() + "%' "); TxtAperson.Text = Convert.ToString(dtAperson.Tables[0].Rows[0]["UMUI_UserName"]); TxtCperson.Text = Convert.ToString(dtCperson.Tables[0].Rows[0]["UMUI_UserName"]); DataSet dtApersonID = neiaL.Search_ForTeacher_HRDDetail("and UMUI_UserName like '%" + hRType.HRPAT_APerson + "%' "); DataSet dtCpersonID = neiaL.Search_ForTeacher_HRDDetail("and UMUI_UserName like '%" + hRType.HRPAT_CPerson + "%' "); TxtNewType.Text = hRType.HRPAT_PType; Label31.Text = hRType.HRPAT_APerson; Label32.Text = hRType.HRPAT_CPerson; UpdatePanel_NewType.Update(); } }
protected void BtnNew_Click(object sender, EventArgs e) { Panel_NewType.Visible = true; UpdatePanel_NewType.Update(); TxtNewType.Text = ""; }