Ejemplo n.º 1
0
 //重置
 protected void Btn_ResetIQCItems_Click(object sender, EventArgs e)
 {
     TxtIQCItems.Text = "";
     DdlstNeedValue.ClearSelection();
     Grid2Cond = "";
     cond2     = " IMMBD_MaterialID='" + Convert.ToString(id2) + "' ";
     BindGrid2M(cond2);
     UpdatePanel_IQCItemsMgt.Update();
 }
Ejemplo n.º 2
0
 //检索栏关闭按钮
 protected void Btn_ClsIQCItems_Click(object sender, EventArgs e)
 {
     TxtIQCItems.Text = "";
     DdlstNeedValue.ClearSelection();
     Panel_IQCItemsMgt.Visible = false;
     UpdatePanel_IQCItemsMgt.Update();
     TxtStandard.Text             = "";
     TxtRemarks.Text              = "";
     Panel_SearchStandard.Visible = false;
     UpdatePanel_SearchStandard.Update();
     Txt_EditItems.Text = "";
     Ddl_EditValues.ClearSelection();
     Panel_EditItems.Visible = false;
     UpdatePanel_EditItems.Update();
     Panel_EditStandard.Visible = false;
     UpdatePanel_EditStandard.Update();
 }
Ejemplo n.º 3
0
 //操作Gridview的命令行
 protected void Grid_Material_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edt_Item")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_Material.SelectedIndex = row.RowIndex;
         GridViewRow gvr = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
         id2 = new Guid(e.CommandArgument.ToString());
         BindGrid2(id2);
         Grid2Cond        = "id";//用id表示grid2绑定id检索,用空表示grid2绑定模糊检索
         TxtIQCItems.Text = "";
         DdlstNeedValue.ClearSelection();
         Panel_IQCItemsMgt.Visible = true;
         UpdatePanel_IQCItemsMgt.Update();
     }
     if (e.CommandName == "Delete_Item")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_Material.SelectedIndex = row.RowIndex;
         Guid guid = new Guid(e.CommandArgument.ToString());
         try
         {
             if (iQCBasicDataL.Delete_IMMaterialBasicData_IQC(guid) <= 0)
             {
                 ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('该物料不属于检验物料,无法删除!')", true);
                 return;
             }
             //expTestL.Insert_ExpSampleType(expSampleType_ExpItems);
         }
         catch (Exception exc)
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除失败!" + exc + "')", true);
         }
         ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除成功!')", true);
         if (guid == id2)//如果点击的检验项目维护与所删除的是同一列,则关闭子级窗口
         {
             TxtIQCItems.Text = "";
             DdlstNeedValue.ClearSelection();
             Panel_IQCItemsMgt.Visible = false;
             UpdatePanel_IQCItemsMgt.Update();
             TxtStandard.Text             = "";
             TxtRemarks.Text              = "";
             Panel_SearchStandard.Visible = false;
             UpdatePanel_SearchStandard.Update();
         }
         BindGrid1(cond1);
         UpdatePanel_GridMaterial.Update();
     }
     if (e.CommandName == "Chs_Item")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_Material.SelectedIndex = row.RowIndex;
         Guid guid = new Guid(e.CommandArgument.ToString());
         try
         {
             if (iQCBasicDataL.Insert_IMMaterialBasicData_IQC(guid) <= 0)
             {
                 ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('该物料已经属于检验物料!')", true);
                 return;
             }
             //expTestL.Insert_ExpSampleType(expSampleType_ExpItems);
         }
         catch (Exception exc)
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('新增失败!" + exc + "')", true);
         }
         ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('新增成功!')", true);
         BindGrid1(cond1);
         UpdatePanel_GridMaterial.Update();
     }
 }