Ejemplo n.º 1
0
 protected void Button_CloseDetail_Click(object sender, EventArgs e)
 {
     Panel_Detail.Visible = false;
     UpdatePanel_Detail.Update();
     GridView_Detail.EditIndex     = 0;
     GridView_Detail.SelectedIndex = 0;
 }
Ejemplo n.º 2
0
 protected void Button_CloseGXLL_Click(object sender, EventArgs e)
 {
     Panel_GXLL.Visible   = false;
     Panel_Detail.Visible = false;
     UpdatePane_GXLL.Update();
     UpdatePanel_Detail.Update();
 }
Ejemplo n.º 3
0
    protected void BindDetail()
    {
        Guid id = new Guid(label53.Text.ToString());

        Gridview_DetailPlan.DataSource = pp.Select_PlanDetail(id);
        Gridview_DetailPlan.DataBind();
        UpdatePanel_Detail.Update();
    }
Ejemplo n.º 4
0
    protected void GridView_Detail_RowUpdating(object sender, GridViewUpdateEventArgs e)//完成编辑
    {
        string id;
        Guid   gid;

        if (GridView_Detail.DataKeys[e.RowIndex].Values["IMRD_ID"].ToString() == "")
        {
            id  = "00000000-0000-0000-0000-000000000000";
            gid = new Guid(id);
        }
        else
        {
            gid = new Guid(GridView_Detail.DataKeys[e.RowIndex].Values["IMRD_ID"].ToString());
        }
        DataSet   ds = wol.s_imrequisitiondetail_ID_workorder(gid);
        DataTable dt = ds.Tables[0];

        if (dt.Rows.Count != 0)
        {
            try
            {
                Guid    imrd_id        = new Guid(GridView_Detail.DataKeys[e.RowIndex].Values["IMRD_ID"].ToString());
                decimal iMRD_ActualNum = ((TextBox)(GridView_Detail.Rows[e.RowIndex].Cells[15].Controls[0])).Text.Trim().ToString() == "" ? 0 : Convert.ToDecimal(((TextBox)(GridView_Detail.Rows[e.RowIndex].Cells[15].Controls[0])).Text.Trim().ToString());
                wol.U_imrequisitiondetail_workorder(imrd_id, iMRD_ActualNum);
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('计划领用量必须为小数形式')", true);

                return;
            }
        }
        else
        {
            try
            {
                Guid    iMRM_RequisitionID = new Guid(Label_IMRM_RequisitionID.Text);
                Guid    iMMBD_MaterialID   = new Guid(GridView_Detail.DataKeys[e.RowIndex].Values["IMMBD_MaterialID"].ToString());
                decimal iMRD_StandardNum   = GridView_Detail.DataKeys[e.RowIndex].Values["suggestNum"].ToString() == "" ? 0 : Convert.ToDecimal(GridView_Detail.DataKeys[e.RowIndex].Values["suggestNum"].ToString());
                decimal iMRD_ActualNum     = ((TextBox)(GridView_Detail.Rows[e.RowIndex].Cells[15].Controls[0])).Text.Trim().ToString() == "" ? 0 : Convert.ToDecimal(((TextBox)(GridView_Detail.Rows[e.RowIndex].Cells[15].Controls[0])).Text.Trim().ToString());
                wol.I_IMRequisitionDetail_WorkOrder(iMRM_RequisitionID, iMMBD_MaterialID, iMRD_StandardNum, iMRD_ActualNum, TextBox_WO_Num.Text.Trim());
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('计划领用量必须为小数形式')", true);

                return;
            }
        }
        GridView_Detail.EditIndex     = -1;
        GridView_Detail.SelectedIndex = -1;
        decimal pnum = Convert.ToDecimal(TextBox_pnum.Text);

        GridView_Detail.DataSource = wol.s_protype_bom_wo_craft(TextBox_WO_ProType.Text, pnum, new Guid(Label_IMRM_RequisitionID.Text), label_pbcname.Text);
        GridView_Detail.DataBind();
        Panel_Detail.Visible = true;
        UpdatePanel_Detail.Update();
    }
Ejemplo n.º 5
0
    //提交采购计划
    protected void TijiaoPlanMain(object sender, EventArgs e)
    {
        Guid id = new Guid(label53.Text.ToString());

        pp.Update_PlanMain_Tijiao(id);
        ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('提交成功!')", true);
        BindPlanMain();
        Panel_Detail.Visible = false;
        UpdatePanel_Detail.Update();
    }
Ejemplo n.º 6
0
    protected void GridView_Detail_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)//取消编辑
    {
        GridView_Detail.EditIndex     = -1;
        GridView_Detail.SelectedIndex = -1;
        decimal pnum = Convert.ToDecimal(TextBox_pnum.Text);

        GridView_Detail.DataSource = wol.s_protype_bom_wo_craft(TextBox_WO_ProType.Text, pnum, new Guid(Label_IMRM_RequisitionID.Text), label_pbcname.Text);
        GridView_Detail.DataBind();
        Panel_Detail.Visible = true;
        UpdatePanel_Detail.Update();
    }
Ejemplo n.º 7
0
    protected void GridView_GXLL_RowCommand(object sender, GridViewCommandEventArgs e) //分工序领料信息表 行命令 查看各领料单详情
    {
        if (e.CommandName == "CheckDetail")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView_GXLL.SelectedIndex = row.RowIndex;
            string[] al = e.CommandArgument.ToString().Split(new char[] { ',' });
            string   iMRM_RequisitionID = al[0];
            Label_IMRM_RequisitionID.Text = iMRM_RequisitionID;
            string pbc_name = al[1];
            label_pbcname.Text = al[1];
            decimal pnum = Convert.ToDecimal(TextBox_pnum.Text);
            GridView_Detail.SelectedIndex = -1;
            GridView_Detail.EditIndex     = -1;
            GridView_Detail.DataSource    = wol.s_protype_bom_wo_craft(TextBox_WO_ProType.Text, pnum, new Guid(iMRM_RequisitionID), pbc_name);
            GridView_Detail.DataBind();

            Panel_Detail.Visible = true;
            UpdatePanel_Detail.Update();
        }
    }
Ejemplo n.º 8
0
    protected void GridView_Detail_RowEditing(object sender, GridViewEditEventArgs e)//编辑状态
    {
        Guid    id = new Guid(GridView_Detail.DataKeys[e.NewEditIndex].Values["IMMBD_MaterialID"].ToString());
        DataSet ds = pp.S_IMRequisitionDetail_IMInventoryMain(id);

        if (ds.Tables[0].Rows.Count == 0)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('库存中还没有该物料!')", true);
            GridView_Detail.EditIndex     = -1;
            GridView_Detail.SelectedIndex = -1;
            return;
        }
        GridView_Detail.SelectedIndex = e.NewEditIndex;
        GridView_Detail.EditIndex     = e.NewEditIndex;
        decimal pnum = Convert.ToDecimal(TextBox_pnum.Text);

        GridView_Detail.DataSource = wol.s_protype_bom_wo_craft(TextBox_WO_ProType.Text, pnum, new Guid(Label_IMRM_RequisitionID.Text), label_pbcname.Text);
        GridView_Detail.DataBind();
        Panel_Detail.Visible = true;
        UpdatePanel_Detail.Update();
    }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         BindDropDownList1();
         BindDropDownList11();
         BindDropDownList111();
         BindPlanMain();
         BindOrder();
         BindMatPlan_Add();
         BindMatPlan_Original();
         BindMatPlan_Week();
         #region 权限
         if (Request.QueryString["status"] == "PurchasingPlanLook")//采购计划查看
         {
             Title           = "采购计划查看";
             Button6.Visible = false;
             UpdatePanel_Search.Update();
             Gridview_MonthPlan.Columns[9].Visible  = false;
             Gridview_MonthPlan.Columns[10].Visible = false;
             Gridview_MonthPlan.Columns[11].Visible = false;
             UpdatePanel_MonthPlan.Update();
             Gridview_DetailPlan.Columns[11].Visible = false;
             Gridview_DetailPlan.Columns[12].Visible = false;
             Gridview_DetailPlan.Columns[13].Visible = false;
             Button31.Visible = false;
             Button2.Visible  = false;
             Button33.Visible = false;
             UpdatePanel_Detail.Update();
         }
         if (Request.QueryString["status"] == "PurchasingPlanEdit")//采购计划维护
         {
             Title                  = "采购计划维护";
             Button6.Visible        = true;
             ButtonPro.Visible      = true;
             Cbx2_SelectAll.Visible = true;
             Button8.Visible        = true;
             CheckBox1.Visible      = true;
             UpdatePanel_Search.Update();
             Gridview_MonthPlan.Columns[9].Visible  = true;
             Gridview_MonthPlan.Columns[10].Visible = false;
             Gridview_MonthPlan.Columns[11].Visible = true;
             UpdatePanel_MonthPlan.Update();
             Gridview_DetailPlan.Columns[11].Visible = true;
             Gridview_DetailPlan.Columns[12].Visible = true;
             Gridview_DetailPlan.Columns[13].Visible = true;
             Button31.Visible = true;
             Button2.Visible  = false;
             Button33.Visible = true;
             UpdatePanel_Detail.Update();
         }
         if (Request.QueryString["status"] == "PurchasingPlanCheck")//采购计划审核
         {
             Title           = "采购计划审核";
             Button6.Visible = false;
             UpdatePanel_Search.Update();
             Gridview_MonthPlan.Columns[9].Visible  = false;
             Gridview_MonthPlan.Columns[10].Visible = true;
             Gridview_MonthPlan.Columns[11].Visible = false;
             UpdatePanel_MonthPlan.Update();
             Gridview_DetailPlan.Columns[11].Visible = false;
             Gridview_DetailPlan.Columns[12].Visible = false;
             Gridview_DetailPlan.Columns[13].Visible = false;
             Button31.Visible = false;
             Button2.Visible  = false;
             Button33.Visible = false;
             UpdatePanel_Detail.Update();
         }
         if (Request.QueryString["status"] == "PurchasingPlanBuy")//采购计划执行
         {
             Title                  = "采购计划执行";
             ButtonPro.Visible      = true;
             Button8.Visible        = true;
             Button17.Visible       = true;
             Cbx2_SelectAll.Visible = true;
             CheckBox1.Visible      = true;
             CheckBox3.Visible      = true;
             Button6.Visible        = false;
             UpdatePanel_Search.Update();
             Gridview_MonthPlan.Columns[9].Visible  = false;
             Gridview_MonthPlan.Columns[10].Visible = false;
             Gridview_MonthPlan.Columns[11].Visible = false;
             UpdatePanel_MonthPlan.Update();
             Gridview_DetailPlan.Columns[0].Visible  = true;
             Gridview_DetailPlan.Columns[11].Visible = false;
             Gridview_DetailPlan.Columns[12].Visible = false;
             Gridview_DetailPlan.Columns[13].Visible = false;
             Button31.Visible = false;
             Button2.Visible  = true;
             Button33.Visible = false;
             UpdatePanel_Detail.Update();
         }
         if (Request.QueryString["status"] == "PurchasingPlanMatBuy")//材料周计划执行
         {
             Title = "材料周计划执行";
             Panel_PMPurchaseOrder.Visible = false;
             UpdatePanel_PMPurchaseOrder.Update();
             Button17.Visible     = true;
             CheckBox3.Visible    = true;
             Panel_Search.Visible = false;
             UpdatePanel_Search.Update();
             Panel_MonthPlan.Visible = false;
             UpdatePanel_MonthPlan.Update();
             Panel_Choose.Visible = true;
             Button10.Visible     = false;
             Button11.Visible     = false;
             UpdatePanel_Choose.Update();
             //this.Label6.Text = "6CFEB693-4DE7-49F9-A0C3-2A89A5B990FB";
             BindOrder();
             Panel_PMPurchaseOrder.Visible = false;
             UpdatePanel_PMPurchaseOrder.Update();
         }
         #endregion
     }
 }
Ejemplo n.º 10
0
 //关闭详细表
 protected void CloseDetail(object sender, EventArgs e)
 {
     Panel_Detail.Visible = false;
     UpdatePanel_Detail.Update();
 }
Ejemplo n.º 11
0
    protected void Gridview_MonthPlan_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        GridViewRow gvr = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));

        if (e.CommandName == "Detail1")
        {
            if (Gridview_MonthPlan.Rows[gvr.RowIndex].Cells[3].Text != "待提交")
            {
                Button31.Visible = false;
                Button33.Visible = false;
                Gridview_DetailPlan.Columns[12].Visible = false;
                Gridview_DetailPlan.Columns[13].Visible = false;
                UpdatePanel_Detail.Update();
            }
            else
            {
                if (Request.QueryString["status"] == "PurchasingPlanEdit")//采购计划维护
                {
                    if (Gridview_MonthPlan.Rows[gvr.RowIndex].Cells[3].Text == "已新建")
                    {
                        Button31.Visible = true;
                        Button33.Visible = true;
                        UpdatePanel_Detail.Update();
                    }
                }
            }
            if (Request.QueryString["status"] == "PurchasingPlanBuy")//采购计划zhixing
            {
                if (Gridview_MonthPlan.Rows[gvr.RowIndex].Cells[3].Text != "审核通过")
                {
                    Button2.Visible = false;
                    UpdatePanel_Detail.Update();
                }
                else
                {
                    Button2.Visible = true;
                    UpdatePanel_Detail.Update();
                }
            }
            label53.Text         = e.CommandArgument.ToString();
            Panel_Detail.Visible = true;
            BindDetail();
            UpdatePanel_Detail.Update();
        }

        if (e.CommandName == "Delete1")
        {
            Guid id = new Guid(e.CommandArgument.ToString());
            pp.Delete_PlanMain(id);
            ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('删除成功!')", true);
            BindPlanMain();
        }
        if (e.CommandName == "Check1")
        {
            Label33.Text           = e.CommandArgument.ToString();
            Panel_ADDCheck.Visible = true;
            TextBox_AddMan.Text    = Session["UserName"].ToString().Trim();
            TextBox_Addtime.Text   = DateTime.Now.ToShortDateString();
            UpdatePanel_ADDCheck.Update();
        }
        if (e.CommandName == "Mat1")
        {
            string state = Gridview_MonthPlan.Rows[gvr.RowIndex].Cells[3].Text.ToString();
            if (state == "审核通过")
            {
                label2.Text = e.CommandArgument.ToString();
            }
            label53.Text         = e.CommandArgument.ToString();
            Panel_Choose.Visible = true;
            UpdatePanel_Choose.Update();
        }
    }