示例#1
0
    /// <summary>
    /// 函数名:GridViewShowCraftList_RowCommand
    /// 作者:bush2582
    /// 作用:翻页函数
    /// 日期:2014年1月15号
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void GridViewShowCraftList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (base.Page_Turning(GridViewShowCraftList, e, GridViewShowCraftList.PageIndex, "ASP_Pager_Text") == true)    //当前的命令是否是翻页命令
        {
            Is_Search();
            Panel_Rejects.Visible = false;    //如果工序界面翻页了,则隐藏不良品管理界面

            //关闭新增工序界面
            Panel_ADD_Craft.Visible    = false;
            BlIs_Close_ADD             = false;
            Asp_Input_AddNewCraft.Text = "新增工序";

            UpdatePanel_Rejects.Update();
            UpdatePanel_ADD_Craft.Update();
            UpdatePanel_Search_Craft.Update();
            //base.Bind_Updata(this.GridViewShowCraftList, mProcessCraftMgtL.SList_Craft(), this.UpdatePanel_List_Craft);//更新界面
        }
        else if (e.CommandName == "RejectsClass")                                         //如果是显示不良品界面的命名
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; //获取ROW好获得被单击的行号

            //GuCraftTempID = mProcess_BadProductTypeInfo.CraftID = new Guid(GridViewShowCraftList.DataKeys[row.RowIndex].Value.ToString());//获取工序ID
            GuCraftTempID = mProcess_BadProductTypeInfo.CraftID = new Guid(GridViewShowCraftList.DataKeys[row.RowIndex].Values["PBC_ID"].ToString()); //获取工序ID
            GridViewShowCraftList.SelectedIndex = row.RowIndex;                                                                                       //设定当前被选中的行

            //再次通过查询获取工序名称 注:这里的效率不是很满意,还待提高 这里需要将当前的行数+当前页数*页面的尺寸才能正确的获取数据
            //this.ASP_Label_Rejects_Label.Text = mProcessCraftMgtL.SList_Craft().Tables[0].Rows[row.RowIndex + this.GridViewShowCraftList.PageIndex * this.GridViewShowCraftList.PageSize][1].ToString() + "不良品工艺管理(*号为必填项目)";
            ASP_Label_Rejects_Label.Text = GridViewShowCraftList.DataKeys[row.RowIndex].Values["PBC_Name"].ToString() + "不良品工艺管理(*号为必填项目)";

            //显示不良品工艺管理界面
            Panel_Rejects.Visible             = true;
            Panel_GridViewShowRejects.Visible = true;


            //关闭新增工序界面
            Panel_ADD_Craft.Visible    = false;
            BlIs_Close_ADD             = false;
            Asp_Input_AddNewCraft.Text = "新增工序";

            base.Bind_Updata(GridViewShowRejects,
                             mProcess_BadProductTypeL.SList_BadProduct(mProcess_BadProductTypeInfo),
                             UpdatePanel_Rejects);        //更新界面
            mProcess_BadProductTypeInfo.ResetParameter(); //重置参数

            UpdatePanel_ADD_Craft.Update();
            UpdatePanel_Search_Craft.Update();
        }
    }
示例#2
0
    /// <summary>
    /// 函数名:Asp_ADD_Craft_Btn_Click
    /// 作者:bush2582
    /// 作用:新增一条工艺记录
    /// 日期:2014年1月15号
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Asp_ADD_Craft_Btn_Click(object sender, EventArgs e)
    {
        mProcessCraftMgtInfo.CraftName      = Asp_ADD_Craft_Name_Text.Text.ToString().Trim();   //获取要被新增的工序名
        mProcessCraftMgtInfo.CraftWaringDay = Asp_ADD_DropDownList.SelectedValue.ToString();    //获取预警天数
        mProcessCraftMgtInfo.CraftPassRate  = ASP_ADD_Craft_QualifiedRate_Text.Text.ToString(); //获取合格率参考标准
        mProcessCraftMgtInfo.CraftParameter = ASP_ADD_Craft_Parameter_Text.Text.ToString();     //获取工艺参考

        if (mProcessCraftMgtL.I_Craft(mProcessCraftMgtInfo) == false)                           //如果插入的数据失败会弹出提示,最主要的原因可能是工序重名
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增失败,请检查是否因为工序重名,或则参数设定不正确。例如工艺参数参考太长')", true);
        }

        //重置新增工序模块
        Asp_ADD_Craft_Name_Text.Text          = "";
        ASP_ADD_Craft_QualifiedRate_Text.Text = "";
        ASP_ADD_Craft_Parameter_Text.Text     = "";
        Asp_ADD_DropDownList.SelectedIndex    = -1;

        //关闭新增模块,同时使新增模块上的按钮‘新增工序’的文字变换

        Asp_Input_AddNewCraft.Text = "新增工序";
        BlIs_Close_ADD             = false;
        Panel_ADD_Craft.Visible    = false;


        //关闭不良品界面,如果有的话
        Panel_Rejects.Visible = false;

        //更新页面
        UpdatePanel_ADD_Craft.Update();
        UpdatePanel_Rejects.Update();
        UpdatePanel_Search_Craft.Update();
        base.Bind_Updata(GridViewShowCraftList,
                         mProcessCraftMgtL.SList_Craft(),
                         UpdatePanel_List_Craft);
    }