Example #1
0
 //质检员判定检验合格
 public int Update_IMInStoreDetail_IQC(IQCBasicDataInfo et, string op)
 {
     return(SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, "Prco_U_IMInStoreDetail_IQC",
                                      new SqlParameter("@IMISD_ID", et.IMISD_ID),
                                      new SqlParameter("@IMMBD_MaterialID", et.IMMBD_MaterialID),
                                      new SqlParameter("@IMIDS_QA", et.IMIDS_QA), new SqlParameter("@IQCDT_Result", et.IQCDT_Result),
                                      new SqlParameter("@IQCDT_Input", et.IQCDT_Input), new SqlParameter("@IQCDT_TestPer", et.IQCDT_TestPer),
                                      new SqlParameter("@IQCDT_Description", et.IQCDT_Description), new SqlParameter("@State", et.State),
                                      new SqlParameter("@IQCDT_Op", op)));
 }
Example #2
0
    //待审核按钮
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        IQCBasicDataInfo IQC = new IQCBasicDataInfo();

        IQC.IMISD_ID         = id_IMISD;
        IQC.IMMBD_MaterialID = id_IMMBD_MaterialID;
        IQC.IMIDS_QA         = "";
        IQC.IQCDT_Result     = "待审核";
        string op = TextBox2.Text;

        if (TxtNewNum.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }
        else
        {
            int m1;
            if (int.TryParse(TxtNewNum.Text.Trim(), out m1))
            {
                IQC.IQCDT_Input = m1;
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('投入数请输入整数!')", true);
                return;
            }
        }
        IQC.IQCDT_TestPer     = Session["UserName"].ToString();
        IQC.IQCDT_Description = TxtNewNote.Text.Trim();
        IQC.State             = "0";
        try
        {
            if (iQCBasicDataL.Update_IMInStoreDetail_IQC(IQC, op) <= 0)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('有检验项目没有录入结果!')", true);
                return;
            }
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('录入成功!')", true);
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('有检验项目没有录入结果!')", true);
            return;
        }
        TxtNewNum.Text         = "";
        TxtNewNote.Text        = "";
        Panel_Standard.Visible = false;
        UpdatePanel_Standard.Update();
        Panel_NewExpApp.Visible = false;
        UpdatePanel_NewExpApp.Update();
    }
Example #3
0
    //新增进料检验物料的检验项目
    public int Insert_IQCItemsTable(IQCBasicDataInfo A)
    {
        SqlParameter[] parm = new SqlParameter[3];
        parm[0]       = new SqlParameter("@IMMBD_MaterialID", SqlDbType.UniqueIdentifier);
        parm[0].Value = A.IMMBD_MaterialID;

        parm[1]       = new SqlParameter("@IQCIT_Items", SqlDbType.VarChar, 80);
        parm[1].Value = A.IQCIT_Items;

        parm[2]       = new SqlParameter("@IQCIT_NeedValue", SqlDbType.Char, 2);
        parm[2].Value = A.IQCIT_NeedValue;

        return(SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction,
                                         CommandType.StoredProcedure, "Proc_I_IQCItemsTable", parm));
    }
Example #4
0
    //新增进料检验物料的检验项目的检验标准
    public int Insert_IQCStandardTable(IQCBasicDataInfo BDI)
    {
        SqlParameter[] parm = new SqlParameter[3];
        parm[0]       = new SqlParameter("@IQCIT_ID", SqlDbType.UniqueIdentifier);
        parm[0].Value = BDI.IQCIT_ID;

        parm[1]       = new SqlParameter("@IQCIT_Standard", SqlDbType.VarChar, 400);
        parm[1].Value = BDI.IQCIT_Standard;

        parm[2]       = new SqlParameter("@IQCIT_Remarks", SqlDbType.VarChar, 200);
        parm[2].Value = BDI.IQCIT_Remarks;

        return(SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction,
                                         CommandType.StoredProcedure, "Proc_I_IQCStandardTable", parm));
    }
    //新增
    protected void Btn_NewCFCFRoute_Click(object sender, EventArgs e)
    {
        condSearch4         = "";
        LblState.Text       = "工艺";                          //用“认证”标识grid4处于认证工序检索,“工艺”标识处于认证工艺路线检索
        LblGongxuState.Text = "工艺";                          //用“认证”标识grid4处于认证工序编辑,“工艺”标识处于认证工艺路线编辑
        ((BoundField)Grid_Craft.Columns[1]).ReadOnly = true; //注意类型转换,你所操作的列的类型是BoundField

        ((BoundField)Grid_Craft.Columns[2]).ReadOnly = false;
        //TxtOrder.Text = "";
        //TxtName.Text = "";
        id4 = id3;
        IQCBasicDataInfo IQC = new IQCBasicDataInfo();

        IQC             = iQCBasicDataL.Search_ProType_ID(id3)[0];
        LblSCState.Text = IQC.PT_Name;
        BindGrid4(id4);
        Panel_SearchCraft.Visible = true;
        UpdatePanel_SearchCraft.Update();
    }
Example #6
0
 //操作Gridview的命令行
 protected void Grid_ItemsValue_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edt_ItemValue")
     {
         edit3 = "edit";//用“edit”表示处于编辑状态:可以重置、提交、关闭(不能检索、新增),用空表示非编辑状态:可以检索、新增、重置、关闭(不能提交)
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_ItemsValue.SelectedIndex = row.RowIndex;
         GridViewRow gvr  = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
         Guid        guid = new Guid(e.CommandArgument.ToString());
         iQCBasicDataInfo      = iQCBasicDataL.Search_IQCStandardTable_ID(guid)[0];
         Txt_EditStandard.Text = iQCBasicDataInfo.IQCIT_Standard;
         id3                        = iQCBasicDataInfo.IQCIT_ID;
         idValue                    = iQCBasicDataInfo.IQCST_ID;
         Txt_EditNote.Text          = iQCBasicDataInfo.IQCIT_Remarks;
         Panel_EditStandard.Visible = true;
         UpdatePanel_EditStandard.Update();
     }
     if (e.CommandName == "Delete_ItemValue")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_ItemsValue.SelectedIndex = row.RowIndex;
         Guid guid = new Guid(e.CommandArgument.ToString());
         try
         {
             iQCBasicDataL.Delete_IQCStandardTable(guid);
         }
         catch (Exception exc)
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除失败!" + exc + "')", true);
         }
         ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除成功!')", true);
         Grid3Cond = "";
         cond3     = "";
         cond3R    = "";
         BindGrid3M(id3, cond3, cond3R);
         UpdatePanel_SearchStandard.Update();
     }
 }
 //关闭
 protected void Btn_ClsCFCFRoute_Click(object sender, EventArgs e)
 {
     Panel_CFRoute.Visible = false;
     UpdatePanel_CFRoute.Update();
     if (Panel_GridCFCraft.Visible == false)
     {
         Panel_SearchCraft.Visible = false;
         UpdatePanel_SearchCraft.Update();
     }
     else if (Panel_GridCFCraft.Visible == true)
     {
         ((BoundField)Grid_Craft.Columns[1]).ReadOnly = false;
         ((BoundField)Grid_Craft.Columns[2]).ReadOnly = true;
         LblState.Text = "认证";
         //TxtOrder.Text = "";
         //TxtName.Text = "";
         id4 = id2;
         IQCBasicDataInfo IQC = new IQCBasicDataInfo();
         IQC             = iQCBasicDataL.Search_ProType_ID(id2)[0];
         LblSCState.Text = IQC.PT_Name;
         BindGrid4(id4);
         UpdatePanel_SearchCraft.Update();
     }
 }
Example #8
0
 protected void Btn_EditSubmitStandard_Click(object sender, EventArgs e)
 {
     if (edit3 == "")
     {
         if (Txt_EditStandard.Text == "")
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
             return;
         }
         IQCBasicDataInfo IQC = new IQCBasicDataInfo();
         IQC.IQCIT_ID       = id3;
         IQC.IQCIT_Standard = Txt_EditStandard.Text;
         IQC.IQCIT_Remarks  = Txt_EditNote.Text;
         try
         {
             if (iQCBasicDataL.Insert_IQCStandardTable(IQC) <= 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);
         Txt_EditStandard.Text = "";
         Txt_EditNote.Text     = "";
         Grid3Cond             = "";
         cond3  = "";
         cond3R = "";
         BindGrid3M(id3, cond3, cond3R);
         UpdatePanel_SearchStandard.Update();
     }
     if (edit3 != "")
     {
         if (Txt_EditStandard.Text == "")
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
             return;
         }
         iQCBasicDataInfo.IQCST_ID       = idValue;
         iQCBasicDataInfo.IQCIT_ID       = id3;
         iQCBasicDataInfo.IQCIT_Standard = Txt_EditStandard.Text;
         iQCBasicDataInfo.IQCIT_Remarks  = Txt_EditNote.Text;
         try
         {
             if (iQCBasicDataL.Update_IQCStandardTable(iQCBasicDataInfo) <= 0)
             {
                 ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('该检验标准已经存在!')", true);
                 return;
             }
         }
         catch (Exception exc)
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('编辑失败!" + exc + "')", true);
         }
         ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('编辑成功!')", true);
         edit3 = "";
         Txt_EditStandard.Text = "";
         Txt_EditNote.Text     = "";
         Grid3Cond             = "";
         cond3  = "";
         cond3R = "";
         BindGrid3M(id3, cond3, cond3R);
         UpdatePanel_SearchStandard.Update();
         Panel_EditStandard.Visible = false;
     }
     UpdatePanel_EditStandard.Update();
 }
Example #9
0
 //操作Gridview的命令行
 protected void Grid_IQCItems_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edt_ItemValue")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_IQCItems.SelectedIndex = row.RowIndex;
         GridViewRow gvr = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
         id3 = new Guid(e.CommandArgument.ToString());
         BindGrid3(id3);
         Grid3Cond = "id";//用id表示grid3绑定id检索,用空表示grid3绑定模糊检索
         Panel_SearchStandard.Visible = true;
         UpdatePanel_SearchStandard.Update();
     }
     if (e.CommandName == "Edt_Item")
     {
         edit2 = "edit";
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_IQCItems.SelectedIndex = row.RowIndex;
         GridViewRow gvr  = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
         Guid        guid = new Guid(e.CommandArgument.ToString());
         iQCBasicDataInfo   = iQCBasicDataL.Search_IQCItemsTable_ID(guid)[0];
         Txt_EditItems.Text = iQCBasicDataInfo.IQCIT_Items;
         id2    = iQCBasicDataInfo.IMMBD_MaterialID;
         idItem = iQCBasicDataInfo.IQCIT_ID;
         if (iQCBasicDataInfo.IQCIT_NeedValue == "是")
         {
             Ddl_EditValues.SelectedValue = "1";
         }
         else if (iQCBasicDataInfo.IQCIT_NeedValue == "否")
         {
             Ddl_EditValues.SelectedValue = "2";
         }
         Panel_EditItems.Visible = true;
         UpdatePanel_EditItems.Update();
     }
     if (e.CommandName == "Delete_Item")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_IQCItems.SelectedIndex = row.RowIndex;
         Guid guid = new Guid(e.CommandArgument.ToString());
         try
         {
             iQCBasicDataL.Delete_IQCItemsTable(guid);
         }
         catch (Exception exc)
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除失败!" + exc + "')", true);
         }
         ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除成功!')", true);
         if (guid == id3)//若删除的检验项目打开了子级检验标准,则关闭子级窗口
         {
             TxtStandard.Text             = "";
             TxtRemarks.Text              = "";
             Panel_SearchStandard.Visible = false;
             UpdatePanel_SearchStandard.Update();
         }
         Grid2Cond = "";
         cond2     = " IMMBD_MaterialID='" + Convert.ToString(id2) + "' ";
         BindGrid2M(cond2);
         UpdatePanel_IQCItemsMgt.Update();
     }
 }
Example #10
0
 protected void Btn_EditSubmitIQCItems_Click(object sender, EventArgs e)
 {
     if (edit2 == "")
     {
         if (Txt_EditItems.Text == "")
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
             return;
         }
         if (Ddl_EditValues.SelectedItem.ToString() == "请选择")
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
             return;
         }
         IQCBasicDataInfo IQC = new IQCBasicDataInfo();
         IQC.IMMBD_MaterialID = id2;
         IQC.IQCIT_Items      = Txt_EditItems.Text;
         IQC.IQCIT_NeedValue  = Ddl_EditValues.SelectedItem.ToString();
         try
         {
             if (iQCBasicDataL.Insert_IQCItemsTable(IQC) <= 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);
         Txt_EditItems.Text = "";
         Ddl_EditValues.ClearSelection();
         Grid2Cond = "";
         cond2     = " IMMBD_MaterialID='" + Convert.ToString(id2) + "' ";
         BindGrid2M(cond2);
         UpdatePanel_IQCItemsMgt.Update();
     }
     if (edit2 != "")
     {
         if (Txt_EditItems.Text == "")
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
             return;
         }
         if (Ddl_EditValues.SelectedItem.ToString() == "请选择")
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
             return;
         }
         iQCBasicDataInfo.IQCIT_ID         = idItem;
         iQCBasicDataInfo.IMMBD_MaterialID = id2;
         iQCBasicDataInfo.IQCIT_Items      = Txt_EditItems.Text;
         iQCBasicDataInfo.IQCIT_NeedValue  = Ddl_EditValues.SelectedItem.ToString();
         try
         {
             if (iQCBasicDataL.Update_IQCItemsTable(iQCBasicDataInfo) <= 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);
         edit2 = "";
         Txt_EditItems.Text = "";
         Ddl_EditValues.ClearSelection();
         Grid2Cond = "";
         cond2     = " IMMBD_MaterialID='" + Convert.ToString(id2) + "' ";
         BindGrid2M(cond2);
         UpdatePanel_IQCItemsMgt.Update();
         Panel_EditItems.Visible = false;
     }
     UpdatePanel_EditItems.Update();
 }
Example #11
0
    //提交
    protected void BtnTijiao_Click(object sender, EventArgs e)
    {
        IQCBasicDataInfo IQC = new IQCBasicDataInfo();

        IQC.IMISD_ID         = id_IMISD;
        IQC.IMMBD_MaterialID = id_IMMBD_MaterialID;
        IQC.IMIDS_QA         = "";
        IQC.IQCDT_Result     = "待审核";
        if (TxtNewNum.Text == "" || Ddl_AuRe.SelectedValue == "请选择")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }
        else
        {
            if (TxtActualNum.Text != "" && TxtNewNum.Text != "")
            {
                decimal come = Convert.ToDecimal(TxtActualNum.Text.ToString());
                decimal chou = Convert.ToDecimal(TxtNewNum.Text.ToString());
                if (chou > come)
                {
                    ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('抽检数量大于到货数量,此操作违法,请注意单位!')", true);
                    return;
                }
            }
        }
        //else
        //{
        //    int m1;
        //    if (int.TryParse(TxtNewNum.Text.Trim(), out m1))
        //        IQC.IQCDT_Input = m1;
        //    else
        //    {
        //        ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('投入数请输入整数!')", true);
        //        return;
        //    }
        //}
        IQC.IQCDT_Input       = Convert.ToDecimal(TxtNewNum.Text.ToString());
        IQC.IQCDT_TestPer     = Session["UserName"].ToString();
        IQC.IQCDT_Description = TxtNewNote.Text.Trim();
        IQC.State             = Ddl_AuRe.SelectedValue.ToString();
        Guid   id           = new Guid(Label31.Text);
        Guid   inID         = new Guid(Label32.Text.ToString());
        Guid   immaterialID = new Guid(Label33.Text);
        string op           = TextBox2.Text;

        try
        {
            if (iQCBasicDataL.Update_IMInStoreDetail_IQC(IQC, op) <= 0)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('有检验项目没有录入结果!')", true);
                return;
            }
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('录入成功!')", true);
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('有检验项目没有录入结果!')", true);
            return;
        }

        TxtNewNum.Text         = "";
        TxtNewNote.Text        = "";
        Panel_Standard.Visible = false;
        UpdatePanel_Standard.Update();
        Panel_NewExpApp.Visible = false;
        UpdatePanel_NewExpApp.Update();
        string remind = "ERP系统消息:" + Session["UserName"].ToString() + "于" + DateTime.Now.ToString("F") + "提交了新的入库检验单,请及时进行审核!";
        string sErr   = RTXhelper.Send(remind, "进料检验审核");

        if (!string.IsNullOrEmpty(sErr))
        {
            ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('" + sErr + "')", true);
        }
    }
Example #12
0
    //操作Gridview的命令行
    protected void Grid_Material_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "New_CertMessage")
        {
            Label28.Text = e.CommandArgument.ToString();

            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_Material.SelectedIndex = row.RowIndex;
            GridViewRow gvr = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
            Label29.Text = "入库单号:" + Grid_Material.Rows[gvr.RowIndex].Cells[2].Text.ToString().Trim() + "  检验物料:" + Grid_Material.Rows[gvr.RowIndex].Cells[4].Text.ToString().Trim() + Grid_Material.Rows[gvr.RowIndex].Cells[6].Text.ToString().Trim() + "  批号:" + Grid_Material.Rows[gvr.RowIndex].Cells[7].Text.ToString().Trim() + "  供货单位:" + Grid_Material.Rows[gvr.RowIndex].Cells[8].Text.ToString().Trim() + "  于" + Grid_Material.Rows[gvr.RowIndex].Cells[11].Text.ToString().Trim() + "入库,共" + Grid_Material.Rows[gvr.RowIndex].Cells[9].Text.ToString().Trim() + Grid_Material.Rows[gvr.RowIndex].Cells[10].Text.ToString().Trim();
            id2          = new Guid(e.CommandArgument.ToString());
            Panel_AddWorkOrder.Visible = true;
            TextBox_AddPT.Text         = "";
            TextBox_Add_PNum.Text      = "";
            //TextBox_Add_ChipNum.Text = "";
            TextBox_AddNote.Text = "";
            UpdatePanel_AddWorkOrder.Update();
        }
        if (e.CommandName == "View_CertDetail")
        {
            //string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            //Response.Redirect("../ProductionProcess/WorkOrderCheck.aspx?WO_Type=检验");
            //Response.Write("<script>window.open(\''../ProductionProcess/WorkOrderCheck.aspx?IMISD_ID=" + al[0] + "\'')</script>");
            //Response.Write("<script>window.open(\''../ProductionProcess/WorkOrderCheck.aspx?IMISD_ID="+al[0]+"\'',\''_blank\'')</script>");
            label_GridPageState.Text = e.CommandArgument.ToString();
            Panel_WOmain.Visible     = true;
            databind_main();
        }
        if (e.CommandName == "New_Test")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_Material.SelectedIndex = row.RowIndex;
            Panel_NewExpApp.Visible     = true;
            string[] al   = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   cond = " and IMISD_ID='" + al[0] + "'";
            Label31.Text = Convert.ToString(Guid.NewGuid());
            Label32.Text = al[0];
            Label33.Text = al[2];
            UpdatePanel_NewExpApp.Update();

            id_IMISD            = new Guid(al[0]);
            id_IMMBD_MaterialID = new Guid(al[2]);
            LblExpApp.Text      = "新增 " + al[1] + " 检验单";
            try
            {
                Guid id1 = new Guid(al[0]);
                Guid id2 = new Guid(al[2]);
                iQCBasicDataL.Insert_IQCDetailTable(id1, id2);
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('检验单新增失败!')", true);
                return;
            }
            string cond1 = " and DT.IMISD_ID='" + al[0] + "' and DT.IQCDT_Result='待审核' ";
            //IQCBasicDataInfo IQC1 = iQCBasicDataL.Search_IMInStoreDetail_ViewAu(cond1)[0];
            DataSet   ds = iQCBasicDataL.Search_IMInStoreDetail_Au(cond1);
            DataTable dt = ds.Tables[0];
            if (dt.Rows.Count != 0)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('该物料检验单正在审核,不能继续检验!')", true);
                return;
            }
            IQCBasicDataInfo IQC = iQCBasicDataL.Search_IMInStoreDetail_New(cond)[0];
            TxtNewMaterialType.Text    = IQC.IMMT_MaterialType;
            TxtNewMaterialName.Text    = IQC.IMMBD_MaterialName;
            TxtNewMode.Text            = IQC.IMMBD_SpecificationModel;
            TxtNewMaterialCode.Text    = IQC.IMMBD_MaterialCode;
            TxtNewSupplyName.Text      = IQC.PMSI_SupplyName;
            TxtActualNum.Text          = Convert.ToString(IQC.IMIDS_ActualArrNum);
            TxtNewUnit.Text            = IQC.UnitName;
            TxtNewArrivalTime.Text     = Convert.ToString(IQC.IMISM_InStoreTime);
            Grid_ETTestItem.DataSource = iQCBasicDataL.Search_IQCItemsTable(IQC.IMMBD_MaterialID);
            Grid_ETTestItem.DataBind();
            Guid id = new Guid(Label32.Text.ToString());
            GridView2.DataSource = iQCBasicDataL.Search_WorkOrder(id);
            GridView2.DataBind();
            //GridView2.Visible = true;
            //BindQAItem();
            UpdatePanel_NewExpApp.Update();
        }
    }
Example #13
0
    //提交按钮
    protected void Btn_Submit_Add_Click(object sender, EventArgs e)
    {
        IQCBasicDataInfo IQC = new IQCBasicDataInfo();

        IQC.IMISD_ID         = id_IMISD;
        IQC.IMMBD_MaterialID = id_IMMBD_MaterialID;
        IQC.IQCDT_ID         = id_IQCDT_ID;
        IQC.IQCDT_Auditor    = Session["UserName"].ToString();
        if (Ddl_AuRe.SelectedItem.ToString() == "请选择")
        {
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }
        else
        {
            if (Ddl_AuRe.SelectedItem.ToString() == "降档")
            {
                if (Txt_Jiangdang.Text.Trim() == "")
                {
                    ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
                    return;
                }
            }
            IQC.IQCDT_DownDetail = Txt_Jiangdang.Text.Trim();
            IQC.IMIDS_QA         = Ddl_AuRe.SelectedItem.ToString();
            IQC.IQCDT_Result     = Ddl_AuRe.SelectedItem.ToString();
            IQC.IQCDT_AResult    = Ddl_AuRe.SelectedItem.ToString();
        }
        IQC.IQCDT_ASugg = Txt_AuAug.Text.Trim();

        //if (this.Ddl_IsShengChan.SelectedItem.ToString() == "请选择")
        //{
        //    ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
        //    return;
        //}
        //else
        //{
        IQCBasicDataInfo iqc = new IQCBasicDataInfo();

        //if (Ddl_IsShengChan.SelectedItem.ToString() == "是")
        //    iqc.State = "1";
        //else if (Ddl_IsShengChan.SelectedItem.ToString() == "否")
        iqc.State    = "2";
        iqc.IQCDT_ID = id_IQCDT_ID;
        iqc.WO_Level = DropDownList_Add_level.SelectedItem.ToString();
        try
        {
            iQCBasicDataL.Update_WorkOrder_IQC(iqc);
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('审核失败!')", true);
            return;
        }
        //}
        try
        {
            if (iQCBasicDataL.Update_IMInStoreDetail_IQCAU(IQC) <= 0)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('审核失败!')", true);
                return;
            }
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('审核成功!')", true);
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('审核失败!')", true);
            return;
        }
        BindGrid1(Label30.Text);
        UpdatePanel_GridMaterial.Update();
        Panel_AddWorkOrder.Visible = false;
        UpdatePanel_AddWorkOrder.Update();
    }
Example #14
0
 //操作Gridview的命令行
 protected void Grid_Material_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     //查看检验结果
     if (e.CommandName == "View_CertDetail")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Txt_CheckResult.Enabled     = false;
         Txt_CheckSug.Enabled        = false;
         TextBox2.Enabled            = false;
         Grid_Material.SelectedIndex = row.RowIndex;
         Panel_NewExpApp.Visible     = true;
         string[] al   = e.CommandArgument.ToString().Split(new char[] { ',' });
         string   cond = " and DT.IMISD_ID='" + al[0] + "'";
         id_IMISD            = new Guid(al[0]);
         Label32.Text        = al[0];
         id_IMMBD_MaterialID = new Guid(al[2]);
         LblExpApp.Text      = al[1] + " 检验结果";
         IQCBasicDataInfo IQC = iQCBasicDataL.Search_IMInStoreDetail_ViewAu(cond)[0];//超出索引????原来此处grid略有不同
         TxtNewMaterialType.Text = IQC.IMMT_MaterialType;
         TxtNewMaterialName.Text = IQC.IMMBD_MaterialName;
         TxtNewMode.Text         = IQC.IMMBD_SpecificationModel;
         TxtNewMaterialCode.Text = IQC.IMMBD_MaterialCode;
         TxtNewSupplyName.Text   = IQC.PMSI_SupplyName;
         TxtActualNum.Text       = Convert.ToString(IQC.IMIDS_ActualArrNum);
         TxtNewUnit.Text         = IQC.UnitName;
         TxtNewArrivalTime.Text  = Convert.ToString(IQC.IMISM_InStoreTime);
         TextBox2.Text           = IQC.OP;
         Guid             guid = new Guid(al[3]);
         IQCBasicDataInfo iqc  = iQCBasicDataL.Search_IQCDetailTable(guid)[0];
         TxtNewNum.Text                = Convert.ToString(iqc.IQCDT_Input);
         TxtTestPerson.Text            = iqc.IQCDT_TestPer;
         Txt_CheckTime.Text            = Convert.ToString(iqc.IQCDT_TestTime);
         Txt_CheckResult.SelectedValue = Grid_Material.DataKeys[row.RowIndex]["IQCDT_ProResult"].ToString();
         Txt_CheckSug.Text             = iqc.IQCDT_Description;
         Grid_ETTestItem.DataSource    = iQCBasicDataL.Search_IQCItemsTable(IQC.IMMBD_MaterialID);
         Grid_ETTestItem.DataBind();
         GridView2.DataSource = iQCBasicDataL.Search_WorkOrder(id_IMISD);
         GridView2.DataBind();
         UpdatePanel_NewExpApp.Update();
     }
     //审核
     if (e.CommandName == "New_Test")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Label33.Text                   = Grid_Material.Rows[row.RowIndex].Cells[8].ToString();
         Label37.Text                   = Grid_Material.Rows[row.RowIndex].Cells[8].ToString();
         Ddl_IsShengChan.Enabled        = true;
         Label28.Visible                = false;
         Ddl_IsShengChan.SelectedValue  = "2";
         Ddl_IsShengChan.Enabled        = false;
         DropDownList_Add_level.Enabled = true;
         Txt_AuTime.Enabled             = true;
         Ddl_AuRe.Enabled               = true;
         Txt_AuAug.Enabled              = true;
         Txt_Jiangdang.Enabled          = true;
         Button_Submit_Add.Visible      = true;
         Panel_AddWorkOrder.Visible     = true;
         Label3.Visible                 = false;
         Txt_AuTime.Visible             = false;
         Label25.Visible                = false;
         Txt_AuPer.Visible              = false;
         string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
         Lbl_Check.Text         = al[1] + " 检验结果审核";
         id_IMISD               = new Guid(al[0]);
         id_IMMBD_MaterialID    = new Guid(al[2]);
         id_IQCDT_ID            = new Guid(al[3]);
         Txt_AuPer.Text         = "";
         Txt_AuAug.Text         = "";
         Txt_Jiangdang.Text     = "";
         Ddl_AuRe.SelectedValue = Grid_Material.DataKeys[row.RowIndex]["IQCDT_ProResult"].ToString();
         UpdatePanel_AddWorkOrder.Update();
     }
     //审核查看
     if (e.CommandName == "View_Au")
     {
         Label25.Visible                = true;
         Txt_AuPer.Visible              = true;
         Txt_AuPer.Enabled              = false;
         Txt_AuTime.Enabled             = false;
         Ddl_IsShengChan.Enabled        = false;
         DropDownList_Add_level.Enabled = false;
         Ddl_AuRe.Enabled               = false;
         Txt_AuAug.Enabled              = false;
         Txt_Jiangdang.Enabled          = false;
         Button_Submit_Add.Visible      = false;
         string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
         id_IMISD            = new Guid(al[0]);
         id_IMMBD_MaterialID = new Guid(al[2]);
         id_IQCDT_ID         = new Guid(al[3]);
         IQCBasicDataInfo iqc = new IQCBasicDataInfo();
         try
         {
             iqc = iQCBasicDataL.Search_IQCDetailTable_Au(id_IQCDT_ID)[0];
         }
         catch (Exception)
         {
             ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('该项尚未审核或不需要审核!')", true);
             return;
         }
         if (iqc.IQCDT_Auditor != "")
         {
             Panel_AddWorkOrder.Visible = true;
             Label3.Visible             = true;
             Txt_AuTime.Visible         = true;
             Lbl_Check.Text             = al[1] + " 审核查看";
             Txt_AuPer.Text             = iqc.IQCDT_Auditor;
             Txt_AuTime.Text            = Convert.ToString(iqc.IQCDT_ATime);
             Txt_AuAug.Text             = iqc.IQCDT_ASugg;
             Txt_Jiangdang.Text         = iqc.IQCDT_DownDetail;
             BindDdl_AuRe(iqc.IQCDT_AResult, iqc.IQCDT_DownDetail);
             BindDdl_IsShengChan(iqc.WO_IsShengchan);
             UpdatePanel_AddWorkOrder.Update();
         }
         else
         {
             ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('该项尚未审核或不需要审核!')", true);
             return;
         }
     }
     if (e.CommandName == "Rin")
     {
         GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
         Grid_Material.SelectedIndex = row.RowIndex;
         if (Grid_Material.Rows[row.RowIndex].Cells[17].Text.ToString().Trim() != "驳回")
         {
             ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('此检验单没有被驳回,不需要重新录入检验结果!')", true);
             return;
         }
         Panel_NewExpApp.Visible = true;
         string[] al   = e.CommandArgument.ToString().Split(new char[] { ',' });
         string   cond = " and DT.IMISD_ID='" + al[0] + "'";
         id_IMISD            = new Guid(al[0]);
         Label32.Text        = al[0];
         id_IMMBD_MaterialID = new Guid(al[2]);
         LblExpApp.Text      = al[1] + " 检验结果";
         Label36.Text        = al[3];
         IQCBasicDataInfo IQC = iQCBasicDataL.Search_IMInStoreDetail_ViewAu(cond)[0];//超出索引????原来此处grid略有不同
         TxtNewMaterialType.Text = IQC.IMMT_MaterialType;
         TxtNewMaterialName.Text = IQC.IMMBD_MaterialName;
         TxtNewMode.Text         = IQC.IMMBD_SpecificationModel;
         TxtNewMaterialCode.Text = IQC.IMMBD_MaterialCode;
         TxtNewSupplyName.Text   = IQC.PMSI_SupplyName;
         TxtActualNum.Text       = Convert.ToString(IQC.IMIDS_ActualArrNum);
         TxtNewUnit.Text         = IQC.UnitName;
         TxtNewArrivalTime.Text  = Convert.ToString(IQC.IMISM_InStoreTime);
         TextBox2.Text           = IQC.OP;
         Guid             guid = new Guid(al[3]);
         IQCBasicDataInfo iqc  = iQCBasicDataL.Search_IQCDetailTable(guid)[0];
         TxtNewNum.Text             = Convert.ToString(iqc.IQCDT_Input);
         TxtTestPerson.Text         = iqc.IQCDT_TestPer;
         Txt_CheckTime.Text         = Convert.ToString(iqc.IQCDT_TestTime);
         Txt_CheckResult.Text       = Grid_Material.DataKeys[row.RowIndex]["IQCDT_ProResult"].ToString();
         Txt_CheckSug.Text          = iqc.IQCDT_Description;
         Grid_ETTestItem.DataSource = iQCBasicDataL.Search_IQCItemsTable(IQC.IMMBD_MaterialID);
         Grid_ETTestItem.DataBind();
         GridView2.DataSource = iQCBasicDataL.Search_WorkOrder(id_IMISD);
         GridView2.DataBind();
         Txt_CheckSug.Enabled    = true;
         TextBox2.Enabled        = true;
         Txt_CheckResult.Enabled = true;
         UpdatePanel_NewExpApp.Update();
     }
 }
Example #15
0
 //选择是否继续生产认证样品
 public int Update_WorkOrder_IQC(IQCBasicDataInfo et)
 {
     return(SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, "Proc_U_WorkOrder_IQC",
                                      new SqlParameter("@State", et.State), new SqlParameter("@IQCDT_ID", et.IQCDT_ID),
                                      new SqlParameter("@WO_Level", et.WO_Level)));
 }
    //检索栏检索其他按钮
    //protected void BtnSearchElse_Click(object sender, EventArgs e)
    //{
    //    Grid_ProType.Columns[3].Visible = false;
    //    Grid_ProType.Columns[4].Visible = false;
    //    Grid_ProType.Columns[5].Visible = false;
    //    Grid_ProType.Columns[6].Visible = true;
    //    LblGridProType.Text = "其他产品型号表";
    //    condSearch.Text = "QT";//以此变量存储检索栏是否处于检索其他的状态
    //    if (TxtProSeries.Text != "")
    //    {
    //        PS_Name = TxtProSeries.Text;
    //    }
    //    if (TxtProType.Text != "")
    //    {
    //        PT_Name = TxtProType.Text;
    //    }
    //    BindGrid1QT(PS_Name, PT_Name);
    //    this.UpdatePanel_GridProType.Update();
    //}

    #endregion

    #region 产品型号表Grid1
    //操作Gridview的命令行
    protected void Grid_ProType_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Edt_CFCraft")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_ProType.SelectedIndex = row.RowIndex;
            GridViewRow gvr = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
            id2 = new Guid(e.CommandArgument.ToString());
            IQCBasicDataInfo IQC = new IQCBasicDataInfo();
            IQC             = iQCBasicDataL.Search_ProType_ID(id2)[0];
            LblRZState.Text = IQC.PT_Name;
            BindGrid2(id2);
            Panel_GridCFCraft.Visible = true;
            UpdatePanel_GridCFCraft.Update();
            Panel_CFRoute.Visible = false;
            UpdatePanel_CFRoute.Update();
            condSearch4         = "";
            LblState.Text       = "认证";                           //用“认证”标识grid4处于认证工序检索,“工艺”标识处于认证工艺路线检索
            LblGongxuState.Text = "认证";                           //用“认证”标识grid4处于认证工序编辑,“工艺”标识处于认证工艺路线编辑

            ((BoundField)Grid_Craft.Columns[1]).ReadOnly = false; //注意类型转换,你所操作的列的类型是BoundField

            ((BoundField)Grid_Craft.Columns[2]).ReadOnly = true;

            id4 = id2;
            IQCBasicDataInfo IQC1 = new IQCBasicDataInfo();
            IQC1            = iQCBasicDataL.Search_ProType_ID(id2)[0];
            LblSCState.Text = IQC1.PT_Name;
            BindGrid4(id4);
            UpdatePanel_SearchCraft.Update();
        }
        if (e.CommandName == "Edt_CFRoute")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_ProType.SelectedIndex = row.RowIndex;
            GridViewRow gvr = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
            id3 = new Guid(e.CommandArgument.ToString());
            IQCBasicDataInfo IQC = new IQCBasicDataInfo();
            IQC             = iQCBasicDataL.Search_ProType_ID(id3)[0];
            LblRTState.Text = IQC.PT_Name;
            BindGrid3(id3);
            Panel_CFRoute.Visible = true;
            UpdatePanel_CFRoute.Update();
            Panel_GridCFCraft.Visible = false;
            UpdatePanel_GridCFCraft.Update();
            condSearch4         = "";
            LblState.Text       = "工艺";                          //用“认证”标识grid4处于认证工序检索,“工艺”标识处于认证工艺路线检索
            LblGongxuState.Text = "工艺";                          //用“认证”标识grid4处于认证工序编辑,“工艺”标识处于认证工艺路线编辑
            ((BoundField)Grid_Craft.Columns[1]).ReadOnly = true; //注意类型转换,你所操作的列的类型是BoundField

            ((BoundField)Grid_Craft.Columns[2]).ReadOnly = false;

            id4 = id3;
            IQCBasicDataInfo IQC1 = new IQCBasicDataInfo();
            IQC1            = iQCBasicDataL.Search_ProType_ID(id3)[0];
            LblSCState.Text = IQC1.PT_Name;
            BindGrid4(id4);
            UpdatePanel_SearchCraft.Update();
        }
        if (e.CommandName == "Delete_ProType")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_ProType.SelectedIndex = row.RowIndex;
            Guid guid = new Guid(e.CommandArgument.ToString());
            try
            {
                iQCBasicDataL.Delete_ProType_RZ(guid);
            }
            catch (Exception exc)
            {
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除失败!" + exc + "')", true);
            }
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('删除成功!')", true);
            BindGrid1RZ(PS_Name, PT_Name);
            UpdatePanel_GridProType.Update();
        }
        if (e.CommandName == "Chs_ProType")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            Grid_ProType.SelectedIndex = row.RowIndex;
            Guid guid = new Guid(e.CommandArgument.ToString());
            try
            {
                iQCBasicDataL.Insert_ProType_RZ(guid);
            }
            catch (Exception exc)
            {
                ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('新增失败!" + exc + "')", true);
            }
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alert", "alert('新增成功!')", true);
            BindGrid1QT(PS_Name, PT_Name);
            UpdatePanel_GridProType.Update();
        }
    }