protected void BtnHistoryClose_Click(object sender, EventArgs e) { Panel_History.Visible = false; Panel_Result.Visible = false; UpdatePanel_Result.Update(); UpdatePanel_History.Update(); }//关闭
}//取消 #endregion #region//检验历史表 protected void Grid_History_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit_Detail") { Label23.Text = "编辑"; Panel_Result.Visible = true; ID_HisEdit = new Guid(e.CommandArgument.ToString()); DataSet ds = measApplianceL.Select_MeasApplianceDetail(ID_HisEdit); string m = ds.Tables[0].Rows[0][0].ToString(); TxtNo.Text = ds.Tables[0].Rows[0][1].ToString(); TxtPer.Text = ds.Tables[0].Rows[0][3].ToString(); DateTime dt3 = DateTime.Parse(ds.Tables[0].Rows[0][2].ToString()); TextTime.Enabled = false; TextTime.Text = dt3.ToString("yyyy-MM-dd"); DdlTextResult.SelectedValue = ds.Tables[0].Rows[0][4].ToString(); TextBox10.Text = ds.Tables[0].Rows[0][5].ToString(); UpdatePanel_Result.Update(); }//编辑 if (e.CommandName == "Delete_Detail") { Grid_History.SelectedIndex = -1; Guid guid = new Guid(e.CommandArgument.ToString()); measApplianceL.Delete_MeasApplianceDetail(guid); BindGrid_History(ID_His); UpdatePanel_History.Update(); }//删除 }
}//重置 protected void BtnNew_Click(object sender, EventArgs e) { Panel_New.Visible = true; Label4.Text = "新增"; //TextBox1.Text = ""; //TextBox2.Text = ""; //TextBox3.Text = ""; //TextBox4.Text = ""; //TextBox5.Text = ""; //TextBox6.Text = ""; //TextBox7.Text = ""; //TextBox8.Text = ""; //TextBox9.Text = ""; TextBox1.Text = ""; TextBox11.Text = ""; TextBox2.Text = ""; TextBox12.Text = ""; TextBox4.Text = ""; TextBox3.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; DropDownList1.ClearSelection(); UpdatePanel_New.Update(); Panel_History.Visible = false; Panel_Result.Visible = false; UpdatePanel_Result.Update(); BindGrid_MeasAppliance(""); UpdatePanel_History.Update(); }//新增设备
}//提交 protected void ButtonCancel2_Click(object sender, EventArgs e) { Panel_Result.Visible = false; UpdatePanel_Result.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(); }//提交
private void UpdatePanel_history_result_new() { UpdatePanel_History.Update(); UpdatePanel_Result.Update(); UpdatePanel_New.Update(); }