Exemplo n.º 1
0
 //重置
 protected void BtnResetProType_Click(object sender, EventArgs e)
 {
     TxtProSeries.Text = "";
     TxtProType.Text   = "";
     PS_Name           = "";
     PT_Name           = "";
     if (condSearch.Text == "")
     {
         Grid_ProType.Columns[7].Visible = true;
         Grid_ProType.Columns[4].Visible = true;
         Grid_ProType.Columns[5].Visible = true;
         Grid_ProType.Columns[6].Visible = false;
         LblGridProType.Text             = "认证产品型号表";
         BindGrid1RZ(PS_Name, PT_Name);
     }
     else if (condSearch.Text == "QT")
     {
         Grid_ProType.Columns[7].Visible = false;
         Grid_ProType.Columns[4].Visible = false;
         Grid_ProType.Columns[5].Visible = false;
         Grid_ProType.Columns[6].Visible = true;
         LblGridProType.Text             = "其他产品型号表";
         BindGrid1QT(PS_Name, PT_Name);
     }
     UpdatePanel_SearchProType.Update();
     UpdatePanel_GridProType.Update();
 }
Exemplo n.º 2
0
 //检索栏检索按钮
 protected void BtnSearchProType_Click(object sender, EventArgs e)
 {
     if (Ddl_RZ.SelectedValue == "0")
     {
         Grid_ProType.Columns[7].Visible = false;
         Grid_ProType.Columns[4].Visible = true;
         Grid_ProType.Columns[5].Visible = false;
         Grid_ProType.Columns[6].Visible = true;
         condSearch.Text     = "";//以此变量存储物料检索栏是否处于检索所有的状态
         LblGridProType.Text = "认证产品型号表";
         if (TxtProSeries.Text != "")
         {
             PS_Name = TxtProSeries.Text;
         }
         if (TxtProType.Text != "")
         {
             PT_Name = TxtProType.Text;
         }
         BindGrid1RZ(PS_Name, PT_Name);
         UpdatePanel_GridProType.Update();
     }
     else if (Ddl_RZ.SelectedValue == "1")
     {
         Grid_ProType.Columns[7].Visible = true;
         Grid_ProType.Columns[4].Visible = false;
         Grid_ProType.Columns[5].Visible = false;
         Grid_ProType.Columns[6].Visible = false;
         LblGridProType.Text             = "其他产品型号表";
         condSearch.Text = "QT";//以此变量存储检索栏是否处于检索其他的状态
         if (TxtProSeries.Text != "")
         {
             PS_Name = TxtProSeries.Text;
         }
         if (TxtProType.Text != "")
         {
             PT_Name = TxtProType.Text;
         }
         BindGrid1QT(PS_Name, PT_Name);
         UpdatePanel_GridProType.Update();
     }
 }
Exemplo n.º 3
0
    //检索栏检索其他按钮
    //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();
        }
    }