}//新增年份和月份中的关闭按钮 protected void BtnSearchTime_Click(object sender, EventArgs e) { if (DropDownListYear.Text == "" || DropDownListMonth.Text == "") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } yearInfo.HRPYear_ID = Guid.NewGuid(); yearInfo.HRP_Year = Int32.Parse(DropDownListYear.Text.ToString()); yearInfo.HRP_Month = Int32.Parse(DropDownListMonth.Text.ToString()); yearInfo.HRP_A_State = "未录入"; yearInfo.HRP_C_State = "未审核"; yearInfo.HRP_M_State = "未审核"; yearInfo.HRP_A_Person = Session["UserId"].ToString(); yearInfo.HRPYear_IsDeleted = false; int i = hRPerfYearL.Insert_HRPerformceYear(yearInfo); if (i <= 0) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('重复的年份和月份!')", true); return; } BindGrid1(""); UpdatePanel1.Update(); Panel_Time.Visible = false; UpdatePanel_Time.Update(); } //新增年份和月份中的确定按钮
}//panel1中gridview的检索 protected void BtnNewPanel1_Click(object sender, EventArgs e) { Panel_SearchEmployee.Visible = false; UpdatePanel_SearchEmployee.Update(); Panel2.Visible = false; UpdatePanel2.Update(); Panel3.Visible = false; UpdatePanel3.Update(); Panel_Time.Visible = true; UpdatePanel_Time.Update(); }//panel1中gridview的新增
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditPanel1") { Panel3.Visible = false; UpdatePanel3.Update(); Panel_Time.Visible = false; UpdatePanel_Time.Update(); GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_Detail.SelectedIndex = row.RowIndex; LabelYear.Text = row.Cells[1].Text.ToString(); LabelMonth.Text = row.Cells[2].Text.ToString(); editFlag = row.Cells[4].Text.ToString(); guidYear = new Guid(e.CommandArgument.ToString()); if (editFlag == "未审核") { HRPerformceDetailL hRPerformceDetailL_New = new HRPerformceDetailL(); HRPerformceDetailInfo neiaInfo1_New = new HRPerformceDetailInfo(); DateTime dtimeNew = DateTime.Now; if (LabelYear.Text == "" || LabelMonth.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('年份和月份不能为空!')", true); return; } DataSet dtNew = hRPItemScoreL.Search_HRDDetail_HRPerformAssessType_Year("and HRPerformAssessType.HRPAT_APerson = '" + Session["UserId"] + "'"); DataTable dtNewTable = dtNew.Tables[0]; int count = dtNewTable.Rows.Count; for (int i = 0; i < count; i++) { Guid guid = Guid.NewGuid(); neiaInfo1_New.HRPD_ID = new Guid(guid.ToString()); neiaInfo1_New.HRDD_ID = new Guid(dtNewTable.Rows[i]["HRDD_ID"].ToString()); neiaInfo1_New.HRPYear_ID = new Guid(guidYear.ToString()); neiaInfo1_New.HRPD_Year = Int32.Parse(LabelYear.Text); neiaInfo1_New.HRPD_Month = Int32.Parse(LabelMonth.Text); neiaInfo1_New.HRPD_AState = false; neiaInfo1_New.HRPD_Atime = dtimeNew; neiaInfo1_New.HRPD_APerson = ""; hRPerformceDetailL_New.Insert_HRPerformceDetail(neiaInfo1_New); } Panel_SearchEmployee.Visible = true; BindGridForEmployee(Grid_Detail, ""); Bind_DdlHRPtype(DropDownList1); Bind_DdlDep(DdlSearchDep); Bind_DdlPost(DdlSearchPost, ""); UpdatePanel_SearchEmployee.Update(); } else { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('审核状态下不能进行录入!')", true); return; } } if (e.CommandName == "EditPanel1_View") { Panel_SearchEmployee.Visible = false; UpdatePanel_SearchEmployee.Update(); Panel_Time.Visible = false; UpdatePanel_Time.Update(); Panel2.Visible = false; UpdatePanel2.Update(); GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_Detail.SelectedIndex = row.RowIndex; Guid guidView = new Guid(e.CommandArgument.ToString()); con3 = " and HRPYear_ID ='" + guidView + "'"; Panel3.Visible = true; BindGridView3(con3); UpdatePanel3.Update(); } }//
}//panel1中gridview的重置 protected void BtnCloseTime_Click(object sender, EventArgs e) { Panel_Time.Visible = false; UpdatePanel_Time.Update(); }//新增年份和月份中的关闭按钮