//重置按钮 protected void BtnReset_Click(object sender, EventArgs e) { DropDownList1.Items.Insert(0, new ListItem("请选择", "")); BindDropDownList1(); DropDownList1.SelectedValue = ""; textno.Text = ""; textname.Text = ""; laststar.Text = ""; lastend.Text = ""; neweststar.Text = ""; newestend.Text = ""; //BindGrid_Detail(""); UpdatePanel_Grid.Update(); }
//检索按钮 protected void BtnSearch_Click(object sender, EventArgs e) { Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); if (this.textyear.Text.ToString() == "" || this.textyear.Text.ToString().Length != 4) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('请填入正确的年份!')", true); return; } int year = Convert.ToInt16(textyear.Text.Trim().ToString()); BindGrid_Detail(year); UpdatePanel_Grid.Update(); }
//重置按钮 protected void BtnReset_Click(object sender, EventArgs e) { Senior_DetailOPEN.Visible = true; Senior_DetailCLOSE.Visible = false; Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Panel_Name.Visible = false; UpdatePanel_Name.Update(); textname.Text = ""; UpdatePanel_Grid.Update(); panelGraph.Visible = false; UpdatepanelGraph.Update(); }
//重置按钮 protected void BtnReset_Click(object sender, EventArgs e) { DropDownList1.Items.Insert(0, new ListItem("请选择", "")); BindDropDownList1(); DropDownList1.SelectedValue = ""; DropDownList2.Items.Insert(0, new ListItem("请选择", "")); BindDropDownList2(); DropDownList2.SelectedValue = ""; TextProIdentify.Text = ""; DropDownList3.SelectedValue = ""; TextExpItem.Text = ""; DropDownList4.SelectedValue = ""; startime.Text = ""; endtime.Text = ""; UpdatePanel_Grid.Update(); }
//打印报表按钮 protected void BtnPrint_Click(object sender, EventArgs e) { Senior_DetailOPEN.Visible = true; Senior_DetailCLOSE.Visible = false; Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Panel_Name.Visible = false; UpdatePanel_Name.Update(); if (startime.Text.ToString() == "" || endtime.Text.ToString() == "") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('请填入统计起止时间!')", true); return; } Response.Redirect("../REPORT_cc/EquipOutputPrint.aspx?" + "&EI_No=" + textno.Text.ToString() + "&EN_EquipName=" + textname.Text + "&EMT_Type=" + texttype.Text + "&startime=" + startime.Text + "&endtime=" + endtime.Text); }
//打印报表按钮 protected void BtnPrint_Click(object sender, EventArgs e) { Senior_DetailOPEN.Visible = true; Senior_DetailCLOSE.Visible = false; Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Panel_Name.Visible = false; UpdatePanel_Name.Update(); if (this.textyear.Text.ToString() == "" || this.textyear.Text.ToString().Length != 4) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('请填入正确的年份!')", true); return; } Response.Redirect("../REPORT_cc/EquiptrendPrint.aspx?" + "&Year=" + textyear.Text.ToString().Trim() + "&EN_EquipName=" + textname.Text.ToString()); }
//检索按钮 protected void BtnSearch_Click(object sender, EventArgs e) { Senior_DetailOPEN.Visible = true; Senior_DetailCLOSE.Visible = false; Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Panel_Name.Visible = false; UpdatePanel_Name.Update(); if (startime.Text.ToString() == "" || endtime.Text.ToString() == "") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('请填入统计起止时间!')", true); return; } string condition1 = GetCondition1(); string time = "BETWEEN '" + startime.Text.Trim() + "' AND '" + endtime.Text.Trim() + "'"; BindGrid_Detail(condition1, time); UpdatePanel_Grid.Update(); }
protected void BtnSearch_Click(object sender, EventArgs e) { if (startime.Text.Trim() == "" || endtime.Text.Trim() == "") { ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "alert", "alert('必须填写统计的起止时间!')", true); } else { LblRecordCondition.Text = startime.Text.Trim() == "" ? " " : " and thedate >= '" + startime.Text + "'"; LblRecordCondition.Text += endtime.Text.Trim() == "" ? " " : " and thedate <= '" + endtime.Text + "'"; LblRecordCondition.Text += textno.Text.Trim() == "" ? " " : " and SPI_Name like '%" + textno.Text.Trim() + "%'"; LblRecordCondition.Text += textname.Text.Trim() == "" ? " " : " and PBC_Name like '%" + textname.Text.Trim() + "%'"; LblRecordCondition.Text += texttype.Text.Trim() == "" ? " " : " and WO_Num like '%" + texttype.Text.Trim() + "%'"; LblRecordCondition.Text += TxtStaffNO.Text.Trim() == "" ? " " : " and HRDD_StaffNO like '%" + TxtStaffNO.Text.Trim() + "%'"; LblRecordCondition.Text += TxtStaffName.Text.Trim() == "" ? " " : " and HRDD_Name like '%" + TxtStaffName.Text.Trim() + "%'"; LblRecordCondition.Text += TxtDep.Text.Trim() == "" ? " " : " and BDOS_Name like '%" + TxtDep.Text.Trim() + "%'"; LblRecordCondition.Text += TxtPost.Text.Trim() == "" ? " " : " and HRP_Post like '%" + TxtPost.Text.Trim() + "%'"; BindGrid_Detail(LblRecordCondition.Text); Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); } }
//检索按钮 protected void BtnSearch_Click(object sender, EventArgs e) { Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); if (this.textyear.Text.ToString() == "" || this.textyear.Text.ToString().Length != 4) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('请填入正确的年份!')", true); return; } string year = textyear.Text.Trim().ToString(); string condition = ""; if (DdlSDep.SelectedValue != "") { condition += "and a.部门 like '%" + DdlSDep.SelectedItem.ToString() + "%'"; if (DdlSPost.SelectedValue != "") { condition += "and a.岗位 like '%" + DdlSPost.SelectedValue.ToString() + "%'"; } } BindGrid_Detail(year, condition); UpdatePanel_Grid.Update(); }
//检索按钮 protected void BtnSearch_Click(object sender, EventArgs e) { if (this.TextBox1.Text.Trim() == "") { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('请填写客户名称!')", true); return; } this.Label2.Visible = true; this.Label3.Visible = true; string condition = GetCondition(); BindGrid_Detail(condition); string condition1 = GetCondition1(); BindGridView1(condition1); //应收帐款和账期 DataSet ds = sd.S_SMDetailReport_yszk(condition); DataTable dt = ds.Tables[0]; this.Labelpay.Text = dt.Rows[0][0].ToString(); this.Labeltime.Text = dt.Rows[0][1].ToString(); UpdatePanel_Grid.Update(); }
//检索按钮 protected void BtnSearch_Click(object sender, EventArgs e) { Senior_DetailOPEN.Visible = true; Senior_DetailCLOSE.Visible = false; Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); Panel1.Visible = false; UpdatePanel1.Update(); Panel_Name.Visible = false; UpdatePanel_Name.Update(); panelGraph.Visible = false; UpdatepanelGraph.Update(); if (this.textyear.Text.ToString() == "" || this.textyear.Text.ToString().Length != 4) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('请填入正确的年份!')", true); return; } string condition = GetCondition(); string year = textyear.Text.Trim().ToString(); BindGrid_Detail(condition, year); UpdatePanel_Grid.Update(); }
//检索按钮 protected void BtnSearch_Click(object sender, EventArgs e) { if (DropDownList1.SelectedValue == "") { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('请填写统计类别!')", true); return; } string no = ""; string condition = ""; if (DropDownList1.SelectedItem.Text == "区域名称") { no = DropDownList1.SelectedValue; condition = "and CRMRBI_Name like '%" + TextBox2.Text.ToString() + "%'"; Grid_Detail.Columns[1].Visible = true; Grid_Detail.Columns[2].Visible = false; Grid_Detail.Columns[3].Visible = false; } if (DropDownList1.SelectedItem.Text == "客户名称") { no = DropDownList1.SelectedValue; condition = "and CRMCIF_Name like '%" + TextBox2.Text.ToString() + "%'"; Grid_Detail.Columns[1].Visible = false; Grid_Detail.Columns[2].Visible = true; Grid_Detail.Columns[3].Visible = false; } if (DropDownList1.SelectedItem.Text == "业务员") { no = DropDownList1.SelectedValue; condition = "and CRMCIF_SalesMan like '%" + TextBox2.Text.ToString() + "%'"; Grid_Detail.Columns[1].Visible = false; Grid_Detail.Columns[2].Visible = false; Grid_Detail.Columns[3].Visible = true; } BindGrid_Detail(no, condition); UpdatePanel_Grid.Update(); }
protected void BtnSearch_Click(object sender, EventArgs e) { try { if (startime.Text.Trim() == "" || endtime.Text.Trim() == "") { ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "alert", "alert('必须填写统计的起止时间!')", true); } else { LblRecordCondition.Text = startime.Text.Trim() == "" ? " " : " and thedate >= '" + startime.Text + "'"; LblRecordCondition.Text += endtime.Text.Trim() == "" ? " " : " and thedate <= '" + endtime.Text + "'"; LblRecordCondition.Text += textno.Text.Trim() == "" ? " " : " and SPI_Name like '%" + textno.Text.Trim() + "%'"; LblRecordCondition.Text += textname.Text.Trim() == "" ? " " : " and PBC_Name like '%" + textname.Text.Trim() + "%'"; BindGrid_Detail(LblRecordCondition.Text); Panel_Grid.Visible = true; UpdatePanel_Grid.Update(); } } catch (Exception) { throw; } }
//重置按钮 protected void BtnReset_Click(object sender, EventArgs e) { Panel_Grid.Visible = true; textyear.Text = ""; UpdatePanel_Grid.Update(); }
}//翻页 #endregion #region//计量器具检验列表 protected void Grid_MeasAppliance_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit_Inf") { Label4.Text = "编辑"; GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_MeasAppliance.SelectedIndex = row.RowIndex; Panel_New.Visible = true; measApplianceMan.MAM_EquipID = new Guid(e.CommandArgument.ToString()); ID_Edit = measApplianceMan.MAM_EquipID; DataSet ds = measApplianceL.SelectByID_MeasApplianceMan(measApplianceMan.MAM_EquipID); TextBox1.Text = ds.Tables[0].Rows[0][0].ToString(); TextBox2.Text = ds.Tables[0].Rows[0][1].ToString(); TextBox3.Text = ds.Tables[0].Rows[0][2].ToString(); DateTime dt1 = DateTime.Parse(ds.Tables[0].Rows[0][3].ToString()); TextBox4.Text = dt1.ToString("yyyy-MM-dd"); TextBox5.Text = ds.Tables[0].Rows[0][4].ToString(); TextBox6.Text = ds.Tables[0].Rows[0][5].ToString(); TextBox7.Text = ds.Tables[0].Rows[0][6].ToString(); DateTime dt2 = DateTime.Parse(ds.Tables[0].Rows[0][7].ToString()); TextBox8.Text = dt2.ToString("yyyy-MM-dd"); TextBox9.Text = ds.Tables[0].Rows[0][8].ToString(); TextBox11.Text = ds.Tables[0].Rows[0][9].ToString(); TextBox12.Text = ds.Tables[0].Rows[0][10].ToString(); DropDownList1.Text = ds.Tables[0].Rows[0][11].ToString(); Label24.Text = Grid_MeasAppliance.Rows[GetCurrentGridViewRowIndex(e).RowIndex].Cells[1].Text.ToString() + "的设备信息进行"; Panel_History.Visible = false; Panel_Result.Visible = false; UpdatePanel_history_result_new(); }//编辑 if (e.CommandName == "Delete_Inf") { Grid_MeasAppliance.SelectedIndex = -1; Guid guid = new Guid(e.CommandArgument.ToString()); try { if (measApplianceL.Delete_MeasApplianceMan(guid) <= 0) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('不能删除!')", true); } else { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除成功!')", true); if (BlInto_S_Search == true) { BindGrid_MeasAppliance(Condition); } if (BlInto_S_Search == false) { BindGrid_MeasAppliance(""); } UpdatePanel_Grid.Update(); } } catch (Exception ex) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除失败!" + ex.ToString() + "')", true); } }//删除 if (e.CommandName == "Look_TestResult") { //GridViewRow row = GetCurrentGridViewRowIndex(e); Grid_MeasAppliance.SelectedIndex = GetCurrentGridViewRowIndex(e).RowIndex; measApplianceDetail.MAM_EquipID = new Guid(Grid_MeasAppliance.DataKeys[GetCurrentGridViewRowIndex(e).RowIndex].Value.ToString()); ID_His = measApplianceDetail.MAM_EquipID; //设置是在检验哪个设备的标签 ASP_Label_Show_History.Text = Grid_MeasAppliance.Rows[GetCurrentGridViewRowIndex(e).RowIndex].Cells[1].Text.ToString() + "的检验历史"; BindGrid_History(measApplianceDetail.MAM_EquipID); measApplianceL.Select_MeasApplianceDetail(measApplianceDetail.MAM_EquipID); Panel_History.Visible = true; Panel_New.Visible = false; Panel_Result.Visible = false; UpdatePanel_history_result_new(); }//检验历史 if (e.CommandName == "TestResult") { //获取登录人,设置成检验人 Label TextTemp = Master.FindControl("LabelUserName") as Label; TxtPer.Text = Session["UserName"].ToString().Trim(); //this.TxtPer.ReadOnly = true; TextTime.Enabled = true; Panel_Result.Visible = true; Label23.Text = "录入"; TxtNo.Text = ""; TextTime.Text = DateTime.Now.ToString(); DdlTextResult.ClearSelection(); TextBox10.Text = ""; GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Grid_MeasAppliance.SelectedIndex = row.RowIndex; temp = new Guid(Grid_MeasAppliance.DataKeys[row.RowIndex].Value.ToString()); ASP_Lable_Result.Text = Grid_MeasAppliance.Rows[row.RowIndex].Cells[1].Text.ToString() + "的检验结果"; Panel_History.Visible = false; Panel_New.Visible = false; UpdatePanel_history_result_new(); }//检验结果录入 }
protected void BtnOK_Click(object sender, EventArgs e) { if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "" || TextBox4.Text == "" || TextBox5.Text == "" || TextBox6.Text == "" || TextBox7.Text == "" || TextBox8.Text == "" || TextBox9.Text == "" || TextBox11.Text == "" || TextBox12.Text == "" || DropDownList1.SelectedValue == "") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } DateTime din, dready; DateTime.TryParse(TextBox4.Text, out din); DateTime.TryParse(TextBox8.Text, out dready); if (dready < din) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('待验日期必须大于送达日期!')", true); return; } if (IsMatchInt(TextBox7.Text, 0) == false) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验周期必须是大于0的整数!')", true); return; } if (IsMatchInt(TextBox9.Text, 0) == false) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验提醒天数必须是大于0的整数!')", true); return; } if (TextBox1.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('设备名称不能为空!')", true); return; } else { measApplianceMan.MAM_EquipName = TextBox1.Text; } if (TextBox2.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('出厂编号不能为空!')", true); return; } else { measApplianceMan.MAM_ManuCode = TextBox2.Text; } if (TextBox3.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('设备位置不能为空!')", true); return; } else { measApplianceMan.MAM_Location = TextBox3.Text; } DateTime d1; if (DateTime.TryParse(TextBox4.Text, out d1)) { measApplianceMan.MAM_ToDate = d1; } else { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入正确的送达日期!')", true); return; } if (TextBox5.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('厂家精度不能为空!')", true); return; } else { measApplianceMan.MAM_OAccuracy = TextBox5.Text; } if (TextBox6.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('精度要求不能为空!')", true); return; } else { measApplianceMan.MAM_IAccuracy = TextBox6.Text; } if (TextBox7.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验周期不能为空!')", true); return; } else { measApplianceMan.MAM_Period = Convert.ToInt32(TextBox7.Text); } if (measApplianceMan.MAM_Period < 0) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验周期不合法!')", true); return; } DateTime d2; if (DateTime.TryParse(TextBox8.Text, out d2)) { measApplianceMan.MAM_ToBeTestDate = d2; } else { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入正确的待检日期!')", true); return; } if (TextBox9.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验提醒天数不能为空!')", true); return; } else { measApplianceMan.MAM_RemindDays = Convert.ToInt32(TextBox9.Text); } if (measApplianceMan.MAM_RemindDays < 0) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验提醒天数不合法!')", true); return; } measApplianceMan.MAM_EquipType = TextBox11.Text; measApplianceMan.MAM_ManuName = TextBox12.Text; measApplianceMan.MAM_Isunused = DropDownList1.Text; if (Label4.Text == "新增") { measApplianceL.Insert_MeasApplianceMan(measApplianceMan); } if (Label4.Text == "编辑") { measApplianceMan.MAM_EquipID = ID_Edit; measApplianceL.Update_MeasApplianceMan(measApplianceMan); } Panel_New.Visible = false; UpdatePanel_New.Update(); if (BlInto_S_Search == true) { BindGrid_MeasAppliance(Condition); } if (BlInto_S_Search == false) { BindGrid_MeasAppliance(""); } UpdatePanel_Grid.Update(); }//提交
}//取消 #endregion #region//检验结果 protected void ButtonSubmit_Click(object sender, EventArgs e) { if (TxtNo.Text == "" || TextTime.Text == "") { ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } DateTime din, Check; DateTime.TryParse(TextTime.Text, out Check); DateTime.TryParse(Grid_MeasAppliance.Rows[Grid_MeasAppliance.SelectedIndex].Cells[12].Text.ToString(), out din); if (din > Check) { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验日期必须大于送达日期!')", true); return; } if (TxtNo.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验单号不能为空!')", true); return; } else { measApplianceDetail.MAD_TestNo = TxtNo.Text; } if (TxtPer.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验人不能为空!')", true); return; } else { measApplianceDetail.MAD_TestPer = TxtPer.Text; } DateTime d3; if (DateTime.TryParse(TextTime.Text, out d3)) { measApplianceDetail.MAD_TestTime = d3; } else { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('请输入正确的检验时间!')", true); return; } if (DdlTextResult.SelectedValue == "") { ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('检验结果不能为空!')", true); return; } else { measApplianceDetail.MAD_Result = DdlTextResult.SelectedValue; } measApplianceDetail.MAD_Remarks = TextBox10.Text.Trim(); measApplianceDetail.MAM_EquipID = temp; if (Label23.Text == "录入") { measApplianceL.Insert_MeasApplianceDetail(measApplianceDetail); BindGrid_History(temp); } if (Label23.Text == "编辑") { measApplianceDetail.MAD_DetailID = ID_HisEdit; measApplianceL.Update_MeasApplianceDetail(measApplianceDetail); BindGrid_History(ID_His); } Panel_Result.Visible = false; UpdatePanel_Result.Update(); UpdatePanel_History.Update(); UpdatePanel_Grid.Update(); if (BlInto_S_Search == true) { BindGrid_MeasAppliance(Condition); } if (BlInto_S_Search == false) { BindGrid_MeasAppliance(""); } UpdatePanel_Grid.Update(); }//提交
//重置按钮 protected void BtnReset_Click(object sender, EventArgs e) { DropDownList1.SelectedIndex = -1; TextBox2.Text = ""; UpdatePanel_Grid.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 BtnReset_Click(object sender, EventArgs e) { startime.Text = ""; endtime.Text = ""; UpdatePanel_Grid.Update(); }