コード例 #1
0
 protected void GridView_CraftMgt_Updating(object sender, GridViewUpdateEventArgs e)
 {
     try
     {
         cminfo.PRD_ID = new Guid(GridView_CraftMgt.DataKeys[e.RowIndex].Values["PRD_ID"].ToString());
         //string a = GridView_CraftMgt.Rows[e.RowIndex].Cells[2].Text.Trim().ToString();
         //string b = GridView_CraftMgt.Rows[e.RowIndex].Cells[4].Text.Trim().ToString();
         //string c = GridView_CraftMgt.Rows[e.RowIndex].Cells[1].Text.Trim().ToString();
         cminfo.PRD_Order = Convert.ToInt16(((TextBox)(GridView_CraftMgt.Rows[e.RowIndex].Cells[2].Controls[0])).Text.Trim().ToString());
         cminfo.PRD_Note  = ((TextBox)(GridView_CraftMgt.Rows[e.RowIndex].Cells[6].Controls[0])).Text.Trim().ToString();
         cminfo.PRD_Doc   = ((TextBox)(GridView_CraftMgt.Rows[e.RowIndex].Cells[4].Controls[0])).Text.Trim().ToString();
         cminfo.PRD_Way   = ((TextBox)(GridView_CraftMgt.Rows[e.RowIndex].Cells[5].Controls[0])).Text.Trim().ToString();
         cmpr.U_ProcessRoute_PRDetail(cminfo);
     }
     catch (Exception)
     {
         ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('排序必须是整数!')", true);
         return;
     }
     GridView_CraftMgt.SelectedIndex = -1;
     GridView_CraftMgt.EditIndex     = -1;
     GridView_CraftMgt.DataSource    = cmpr.S_ProcessRoute_PRDetail(new Guid(Label_PRID.Text));
     GridView_CraftMgt.DataBind();
     UpdatePanel_CraftMgt.Update();
 }
コード例 #2
0
    protected void GridView_CraftMgt_RowCommand(object sender, GridViewCommandEventArgs e) //工艺路线链接按钮事件
    {
        if (e.CommandName == "Delete_CraftMgt")                                            //删除工艺路线所属工序
        {
            //无关信息隐藏
            Panel_Craft.Visible = false;
            UpdatePanel_Craft.Update();

            GridView_CraftMgt.SelectedIndex = -1;
            GridView_CraftMgt.EditIndex     = -1;


            string prdid = e.CommandArgument.ToString();
            cminfo.PRD_ID = new Guid(prdid);
            cmpr.D_ProcessRoute_PRDetail(cminfo);
            GridView_CraftMgt.DataSource = cmpr.S_ProcessRoute_PRDetail(new Guid(Label_PRID.Text));
            GridView_CraftMgt.DataBind();
            UpdatePanel_CraftMgt.Update();
            DataSet   ds3 = cmpr.S_ProcessRoute_PRDetail(new Guid(Label_PRID.Text));
            DataTable dt3 = ds3.Tables[0];
            if (dt3.Rows.Count != 0)
            {
                Button_copy.Attributes.Add("OnClick", "return confirm('工艺路线中已存在部分工序,是否仍然复制插入?')");
            }
            else
            {
                Button_copy.Attributes.Remove("OnClick");
                Button_copy.Attributes.Add("OnClick", "return confirm('工艺路线中尚无工序,将会复制所选工艺路线中的工序,确定吗?')");
            }
        }
    }
コード例 #3
0
    protected void GridView_CraftMgt_CancelingEdit(object sender, GridViewCancelEditEventArgs e) //工艺路线表取消编辑
    {                                                                                            //无关信息隐藏
        Panel_Craft.Visible = false;
        UpdatePanel_Craft.Update();

        GridView_CraftMgt.SelectedIndex = -1;
        GridView_CraftMgt.EditIndex     = -1;
        GridView_CraftMgt.DataSource    = cmpr.S_ProcessRoute_PRDetail(new Guid(Label_PRID.Text));
        GridView_CraftMgt.DataBind();
        UpdatePanel_CraftMgt.Update();
    }
コード例 #4
0
    protected void GridView_CraftMgt_Editing(object sender, GridViewEditEventArgs e)//显示编辑工序管理列表状态
    {
        GridView_CraftMgt.EditIndex = e.NewEditIndex;

        //无关信息隐藏
        Panel_Craft.Visible = false;
        UpdatePanel_Craft.Update();



        GridView_CraftMgt.DataSource = cmpr.S_ProcessRoute_PRDetail(new Guid(Label_PRID.Text));
        GridView_CraftMgt.DataBind();
        UpdatePanel_CraftMgt.Update();
    }
コード例 #5
0
 protected void Button_Craft_Click(object sender, EventArgs e)//检索工艺文件表
 {
     foreach (GridViewRow item in GridView_Craft.Rows)
     {
         CheckBox cb = item.FindControl("CheckBox2") as CheckBox;
         if (cb.Checked)
         {
             Guid prid  = new Guid(Label_PRID.Text.ToString());
             Guid pbcid = new Guid(GridView_Craft.DataKeys[item.RowIndex].Value.ToString());
             cmpr.I_PRDetail_PBCraftInfo(prid, pbcid);
             GridView_CraftMgt.DataSource = cmpr.S_ProcessRoute_PRDetail(prid);
             GridView_CraftMgt.DataBind();
             Panel_CraftMgt.Visible = true;
             UpdatePanel_CraftMgt.Update();
             ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增成功!')", true);
             Panel_Craft.Visible = false;
             UpdatePanel_Craft.Update();
         }
     }
 }
コード例 #6
0
    protected void Btn_copy_Click(object sender, EventArgs e)
    {
        //string script = "if(confirm('该工艺路线已有部分工序信息了,是否还继续复制插入?')) {document.getElementById('Button2').click();} else {return;}";
        Guid prid1 = new Guid(DropDownList1.SelectedValue.ToString().Trim());
        Guid prid2 = new Guid(Label_PRID.Text.Trim());

        try
        {
            if (DropDownList1.SelectedValue.ToString().Trim() == "")
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('尚未选择工艺路线或选择的工艺路线为空,不能复制,请核对!')", true);
                return;
            }
            else
            {
                //if (dt3.Rows.Count != 0)
                //{
                //    // string reference = ClientScript.GetCallbackEventReference(this, "args", "sucess", "", "Error", false);
                //    // string callbackScript="function CallServerMethod(args,context){\n"+reference+";\n"
                //    // string msg = "该工艺路线中已有部分工序,是否继续复制插入?";
                //    // ClientScript.RegisterStartupScript(this.GetType(), "CallServerMethod", callbackScript);
                //    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "confirm", " <script language='javascript' >if(confirm('确认码?'))document.getElementById('Hf').value='1'; else document.getElementById('Hf').value='0'; </script>", true);
                //    ClientScript.RegisterStartupScript(this.GetType(), "confirm", " return if(confirm('确认码?')) document.getElementById('hf').value='1'; else document.getElementById('hf').value='0';");
                //    if (hf.Value.Equals("1"))
                //    {
                //        cmpr.I_CopyPRDetail(prid1, prid2);


                //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('复制成功!')", true);
                //        this.hf.Value = "";
                //        return;
                //    }
                //    if (hf.Value.Equals("0"))
                //    {
                //        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "alert", "alert('已取消复制!')", true);

                //        return;
                //    }

                //}
                //else
                //{
                cmpr.I_CopyPRDetail(prid1, prid2);
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('复制成功!')", true);
                //}
            }
        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('复制失败!')", true);
            return;
        }

        GridView_CraftMgt.DataSource = cmpr.S_ProcessRoute_PRDetail(prid2);
        GridView_CraftMgt.DataBind();
        DataSet   ds3 = cmpr.S_ProcessRoute_PRDetail(prid2);
        DataTable dt3 = ds3.Tables[0];

        if (dt3.Rows.Count != 0)
        {
            Button_copy.Attributes.Add("OnClick", "return confirm('工艺路线中已存在部分工序,是否仍然复制插入?')");
        }
        else
        {
            Button_copy.Attributes.Remove("OnClick");
            Button_copy.Attributes.Add("OnClick", "return confirm('工艺路线中尚无工序,将会复制所选工艺路线中的工序,确定吗?')");
        }
        UpdatePanel_CraftMgt.Update();
    }
コード例 #7
0
    protected void GridView_PR_RowCommand(object sender, GridViewCommandEventArgs e) //工艺路线表中的链接按钮事件
    {
        if (e.CommandName == "CraftMgt000")                                          //工艺路线所属工序管理
        {
            Panel_CraftMgt.Visible = true;
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_PR.SelectedIndex = row.RowIndex;
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   id = al[0];
            Label_prnamecheck.Text = al[1];
            Guid prid = new Guid(id);
            Label_PRID.Text = id;
            GridView_CraftMgt.DataSource = cmpr.S_ProcessRoute_PRDetail(prid);
            GridView_CraftMgt.DataBind();
            GridView_CraftMgt.SelectedIndex = -1;
            Panel_AddOrEditPR.Visible       = false;
            Panel_CraftMgt.Visible          = true;
            Panel_Craft.Visible             = false;
            UpdatePanel_AddOrEditPR.Update();
            UpdatePanel_Craft.Update();
            DropDownList1.DataSource     = ppl.S_PR_Name();
            DropDownList1.DataTextField  = "PR_Name";
            DropDownList1.DataValueField = "PR_ID";
            DropDownList1.DataBind();
            DataSet   ds3 = cmpr.S_ProcessRoute_PRDetail(prid);
            DataTable dt3 = ds3.Tables[0];
            if (dt3.Rows.Count != 0)
            {
                Button_copy.Attributes.Add("OnClick", "return confirm('工艺路线中已存在部分工序,是否仍然复制插入?')");
            }
            else
            {
                Button_copy.Attributes.Remove("OnClick");
                Button_copy.Attributes.Add("OnClick", "return confirm('工艺路线中尚无工序,将会复制所选工艺路线中的工序,确定吗?')");
            }
            UpdatePanel_CraftMgt.Update();
        }
        if (e.CommandName == "Edit_PR")//编辑工艺路线
        {
            //无关信息隐藏
            //  this.Panel_PR.Visible = false;
            //  this.Panel_AddOrEditPR.Visible = false;
            Panel_CraftMgt.Visible          = false;
            Panel_Craft.Visible             = false;
            GridView_CraftMgt.EditIndex     = -1;
            GridView_CraftMgt.SelectedIndex = -1;
            // GridView_PR.EditIndex = -1;
            //   GridView_PR.SelectedIndex = -1;
            //   UpdatePanel_PR.Update();
            //   UpdatePanel_AddOrEditPR.Update();
            UpdatePanel_CraftMgt.Update();
            UpdatePanel_Craft.Update();



            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_PR.SelectedIndex = row.RowIndex;
            label_AddOrEdit.Text      = "编辑";
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            Label_PRID.Text = al[0];
            Guid prid = new Guid(al[0]);
            Label_PRName.Text                  = al[1];
            TextBox_AddOrEditPRName.Text       = al[1];
            DropDownList_Special.SelectedValue = al[2];
            Panel_AddOrEditPR.Visible          = true;
            UpdatePanel_AddOrEditPR.Update();
        }
        if (e.CommandName == "Delete_PR") //删除工艺路线
        {
            //无关信息隐藏
            //  this.Panel_PR.Visible = false;
            //  this.Panel_AddOrEditPR.Visible = false;
            Panel_CraftMgt.Visible          = false;
            Panel_Craft.Visible             = false;
            GridView_CraftMgt.EditIndex     = -1;
            GridView_CraftMgt.SelectedIndex = -1;
            // GridView_PR.EditIndex = -1;
            //   GridView_PR.SelectedIndex = -1;
            //   UpdatePanel_PR.Update();
            //   UpdatePanel_AddOrEditPR.Update();
            UpdatePanel_CraftMgt.Update();
            UpdatePanel_Craft.Update();

            GridView_PR.SelectedIndex = -1;
            GridView_PR.EditIndex     = -1;


            string prid = e.CommandArgument.ToString();
            cminfo.PR_ID = new Guid(prid);
            cmpr.D_ProcessRoute(cminfo);
            GridView_PR.DataSource = cmpr.S_ProcessRoute(new Guid(label_cdaid.Text.Trim()));
            GridView_PR.DataBind();
            Panel_PR.Visible = true;
            UpdatePanel_PR.Update();
        }
    }