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 BtnCancelEmployee_Click(object sender, EventArgs e) { Panel_SearchEmployee.Visible = false; Panel_Grid_Detail.Visible = false; UpdatePanel_SearchEmployee.Update(); UpdatePanel_Grid_Detail.Update(); Panel_AddEmployee.Visible = false; UpdatePanel_AddEmployee.Update(); }//关闭员工列表
}//xxx的员工信息栏的“重置” protected void BtnAddEmployee_Click(object sender, EventArgs e) { try { con2 = " and HRPAT_ID is null"; Panel_AddEmployee.Visible = true; BindGridForEmployee(GridViewAdd, con2); } catch (Exception ex) { throw ex; } Bind_DdlDep(DdlAddDep); Bind_DdlPost(DdlAddPost, ""); UpdatePanel_AddEmployee.Update(); }//xxx的员工信息栏的“新增员工”
}// #endregion #region//绩效考核的员工新增栏 protected void BtnAddSearch_Click(object sender, EventArgs e) { //string condition = con2; con2 = TxtAddStaffNO.Text.Trim() == "" ? "" : " and HRDD_StaffNO like '%" + TxtAddStaffNO.Text.Trim() + "%'"; con2 += TxtAddName.Text.Trim() == "" ? "" : " and HRDD_Name like '%" + TxtAddName.Text.Trim() + "%'"; con2 += DdlAddDep.SelectedValue == "" ? "" : " and b.BDOS_Code ='" + DdlAddDep.SelectedValue + "'"; con2 += DdlAddPost.SelectedValue == "" ? "" : " and a.HRP_ID ='" + DdlAddPost.SelectedValue + "'"; try { BindGridForEmployee(GridViewAdd, con2 + " and HRPAT_ID is null"); } catch (Exception ex) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检索失败!" + ex + "')", true); return; } LabelForAddEmployee.Text = "检索后"; UpdatePanel_AddEmployee.Update(); }//员工新增栏的“检索”
}//员工新增栏的“重置” protected void BtnAddSubmit_Click(object sender, EventArgs e) { int count = 0; try { Guid g2 = new Guid(Label50.Text); for (int i = 0; i < GridViewAdd.Rows.Count; i++) { CheckBox cbox = (CheckBox)GridViewAdd.Rows[i].FindControl("CheckBox1"); if (cbox.Checked) { count += 1; Guid g1 = new Guid(GridViewAdd.Rows[i].Cells[0].Text.ToString()); hRPerfL.Insert_HRPerformAssessType_HRDDetail(g1, g2); } } } catch (Exception ex) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('提交失败!" + ex.ToString() + "')", true); } if (count == 0) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请选择需要添加的员工!')", true); return; } BindGridForEmployee(Grid_Detail, con1); //UpdatePanel_SearchEmployee.Update(); UpdatePanel_Grid_Detail.Update(); BindGridForEmployee(GridViewAdd, con2); UpdatePanel_AddEmployee.Update(); Panel_AddEmployee.Visible = false; UpdatePanel_AddEmployee.Update(); ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('提交成功!')", 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(); } }