Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString(); // "四车间";
        _dh       = Request.QueryString["dh"].ToString();       //"W1497589";


        dt_append = new DataTable();
        dt_append.Columns.Add("zyb");
        dt_append.Columns.Add("lot_no");
        dt_append.Columns.Add("act_qty");
        dt_append.Columns.Add("cl");
        dt_append.Columns.Add("yzj_no");
        dt_append.Columns.Add("zyb_lot");
        dt_append.Columns.Add("idno");



        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            txt_emp.Text = lu.WorkCode;
            txt_dh.Text  = _dh;
            ShowValue(txt_emp.Text);
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["workshop"] != null)
        {
            _workshop = Request.QueryString["workshop"].ToString();
        }
        if (Request.QueryString["dh"] != null)
        {
            _dh = Request.QueryString["dh"].ToString();
        }
        if (Request.QueryString["ck"] != null)
        {
            _ck = Request.QueryString["ck"].ToString();
        }

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            //emp_code_name.Text = "02432何桂勤";
        }
        GetData();
    }
Ejemplo n.º 3
0
    public string uri;           //url

    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            //emp_code_name.Text = "02432何桂勤";

            bind_pgino();
            bind_source("");

            timestamp = DateTime.Now.Ticks.ToString().Substring(0, 10);
            noncestr  = new Random().Next(10000).ToString();
            uri       = Request.Url.ToString().Replace("#", "").Replace(WeiXin.Port, ""); //本地地址
            string entAccessTicket = WeiXin.GetEntAccessToken();                          //企业AccessTicket
            ent_ticket    = WeiXin.GetEntJsapi_Ticket(entAccessTicket);
            ent_signature = WeiXin.GetSignature(ent_ticket, noncestr, timestamp, uri);    //企业签名
        }
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _lotno = Request.QueryString["lotno"].ToString();
        _para  = Request.QueryString["para"].ToString();
        if (Request.QueryString["workshop"] != null)
        {
            _workshop = Request.QueryString["workshop"].ToString();
        }
        if (Request.QueryString["needno"] != null)
        {
            _needno = Request.QueryString["needno"].ToString();
        }

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();

        _emp = lu.WorkCode + lu.UserName;
        //_emp = "02432何桂勤";

        GetData(_lotno, lu.WorkCode);
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString(); // "四车间";
        _dh       = Request.QueryString["dh"].ToString();       //"W1497589";


        dt_append = new DataTable();
        dt_append.Columns.Add("sku");
        dt_append.Columns.Add("lot_no");
        dt_append.Columns.Add("need_off_qty");
        dt_append.Columns.Add("need_no");
        dt_append.Columns.Add("idno");
        dt_append.Columns.Add("ps_qty_per");



        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            ViewState["STEPVALUE"] = "";
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            txt_emp.Text = lu.WorkCode;
            txt_dh.Text  = _dh;
            ShowValue(txt_emp.Text);
        }
    }
Ejemplo n.º 6
0
    protected void btnStart_Click(object sender, EventArgs e)
    {
        MES.Model.MES_SB_WX m = new MES.Model.MES_SB_WX();
        string wx_dh          = Request["dh"];

        //txtHidden.Value = wx_dh;
        m.wx_dh         = wx_dh;
        m.wx_begin_date = DateTime.Now;
        m.wx_banbie     = "";                           //txtBanBie.Value;
        m.wx_banzhu     = "";                           //txtBanZu.Value;
        m.wx_gonghao    = WeiXin.GetCookie("workcode"); //dropWXGongHao.SelectedValue;
        m.wx_name       = ((LoginUser)WeiXin.GetJsonCookie()).UserName;
        m.p_status      = "维修中";
        MES.DAL.MES_SB_WX dal = new MES.DAL.MES_SB_WX();
        try
        {
            if (DbHelperSQL.GetSingle("select count(1) from MES.[dbo].[MES_SB_wx] where wx_dh='" + wx_dh + "'").ToString() == "0")
            {
                int result = dal.Add(m);//因经常出现资料未插入事件
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"alert('接修成功.');self.location='BXMonitor.aspx';  ", true);
            }
        }
        catch (Exception ex)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"layer.alert('失败,请重试.[ex:" + ex.Message + "]'); ", true);
        }
        finally { }
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        _workorder   = Request.QueryString["workorder"].ToString();
        _workorder_f = Request.QueryString["workorder_f"].ToString();

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;
            //emp_code_name.Text = "02432何桂勤";
            //domain.Text = "200";

            workorder.Text = _workorder; workorder_f.Text = _workorder_f;
            init_data(_workorder, _workorder_f);
        }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["formno"] != null)
        {
            _formno = Request.QueryString["formno"].ToString();
        }
        if (Request.QueryString["stepid"] != null)
        {
            _stepid = Request.QueryString["stepid"].ToString();
        }

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            //emp_code_name.Text = "02432何桂勤";

            formno.Text = _formno; stepid.Text = _stepid;

            if (_formno != "")
            {
                init_data(_formno, _stepid);
            }
        }
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /*
         * string year = DateTime.Now.Year.ToString();
         * string month = DateTime.Now.Month.ToString();
         * string day = DateTime.Now.Day.ToString();
         *
         * string dn = "白班";
         * DateTime t1 = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
         * DateTime t2 = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd") + " 07:00:00");
         * DateTime t3 = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd") + " 19:00:00");
         *
         * if (DateTime.Compare(t1, t2) >= 0 && DateTime.Compare(t1, t3) <= 0)
         * {
         *  dn = "白班";
         * }
         * else
         * {
         *  dn = "夜班";
         * }
         *
         * file = Server.MapPath(@"/file/" + year + @"/" + month + @"月/" + month + "-" + day + dn + @"/");
         */
        file = Server.MapPath(@"/file/");

        if (Request.QueryString["id"] != null)
        {
            _id = Request.QueryString["id"].ToString();
        }
        if (Request.QueryString["dh"] != null)
        {
            _dh = Request.QueryString["dh"].ToString();
        }                                                                                     //扫码进来的

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }
        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;
            //emp_code_name.Text = "02432何桂勤";
            domain.Text = "200";

            txt_dh.Text = _dh;

            id.Text = _id;
            if (_id != "" || _dh != "")
            {
                init_data(_id, _dh, connString);
            }
        }
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bind_data();

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
        }
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();
        bind_data();

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
        }
    }
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();

        GetData(lu.WorkCode);
    }
Ejemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (WeiXin.GetCookie("workcode") == null)
     {
         Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
         return;
     }
     if (!IsPostBack)
     {
         LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
         txt_empname.Value = lu.WorkCode + lu.UserName;
         // txt_empname.Value = "01744孙娟";
         bind_sb();
     }
 }
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;

            //登入岗位的域
            string strsql_d    = "select * from [Mes_App_EmployeeLogin] with(readpast) where emp_code='" + lu.WorkCode + "' and on_date is not null and off_date is null";
            var    value_login = SQLHelper.reDs(strsql_d).Tables[0];
            if (value_login != null && value_login.Rows.Count > 0)
            {
                if (domain.Text == "100" || domain.Text == "")
                {
                    domain.Text = value_login.Rows[0]["domain"].ToString();
                }
            }

            lbl_emp.Text = lu.Telephone + lu.UserName;
            if (string.IsNullOrEmpty(lu.Telephone)) //增加手机号的获取,因为cookIE里的手机号有可能会是空值
            {
                string strsql     = "select * from [172.16.5.26].[Production].[dbo].[Hrm_Emp] with(nolock) where employeeid = '" + lu.WorkCode + "'";
                var    value_rout = SQLHelper.reDs(strsql).Tables[0];
                if (value_rout != null && value_rout.Rows.Count > 0)
                {
                    lbl_emp.Text = value_rout.Rows[0]["tel"].ToString() + lu.UserName;
                }
            }


            //emp_code_name.Text = "02432何桂勤";
            //domain.Text = "200";
            //lbl_emp.Text = "15850349106何桂勤";

            //绑定岗位
            ShowValue(lu.WorkCode);
            //ShowValue("02432");
        }
    }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }
        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;

            //emp_code_name.Text = "02432何桂勤";
            domain.Text = "200";
        }
    }
Ejemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();

        _workcode = lu.WorkCode;
        GetData(_workcode);

        //_workcode = "02432";
        //GetData("02432");
    }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();
        _lotno    = Request.QueryString["lotno"].ToString();
        _needno   = Request.QueryString["need_no"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }


        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            _emp = lu.WorkCode + lu.UserName;

            load_data(lu.WorkCode);
        }
    }
Ejemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workorder = Request.QueryString["workorder"].ToString();
        _ruku_dh   = Request.QueryString["ruku_dh"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            //emp_code_name.Text = "02432何桂勤";

            emp.Text  = emp_code_name.Text;
            time.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        }
    }
Ejemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = "四车间";      //   Request.QueryString["workshop"].ToString(); // "四车间";//
        _dh       = "G0051234"; // Request.QueryString["dh"].ToString();// "W0000456";
        // lotno = "G0000301";
        //_dh = "W0000450";

        dt_append = new DataTable();
        dt_append.Columns.Add("pgino");
        dt_append.Columns.Add("workorder");
        dt_append.Columns.Add("need_off_qty");
        //dt_append.Columns.Add("need_no");
        dt_append.Columns.Add("idno");

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }
        string strsql = @"select pgino,emp_name,hege_qty,create_date,qc_dh from Mes_App_WorkOrder_QC_History where qc_dh = '{0}'
                         UNION ALL
	                    select pgino,emp_name,-1*act_qty,create_date,workorder from Mes_APP_WorkOrder_CKCK_Hege where   reason ='成品领用'  AND workorder='{0}'"    ;

        strsql = string.Format(strsql, _dh);
        DataTable re_dt = SQLHelper.Query(strsql).Tables[0];

        if (re_dt.Rows.Count > 0)
        {
            Repeater_record.DataSource = re_dt;
            Repeater_record.DataBind();
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            txt_emp.Text           = lu.WorkCode;
            txt_dh.Text            = _dh;
            ViewState["STEPVALUE"] = "";
        }
    }
Ejemplo n.º 20
0
    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        MES.Model.MES_SB_QR m = new MES.Model.MES_SB_QR();
        string wx_dh          = Request["dh"];// GridView1.SelectedRow.Cells[1].Text.Trim();

        m.dh        = wx_dh;
        m.qr_date   = DateTime.Now;
        m.qr_banbie = ""; // txtBanBie.Value;
        m.qr_banzhu = ""; // txtBanZu.Value;
        m.qr_gh     = WeiXin.GetCookie("workcode");
        m.qr_name   = ((LoginUser)WeiXin.GetJsonCookie()).UserName;
        m.qr_remark = this.txtQr_Remark.Value;
        m.p_status  = "确认完成";


        MES.DAL.MES_SB_WX dal = new MES.DAL.MES_SB_WX();
        if (dal.IsExitsQR(m.dh) == 0)//--确认是否重复确认
        {
            dal.Add(m);
        }

        string strSQL = "update MES_SB_BX set [status]='" + m.p_status + "' where bx_dh='" + m.dh + "';";

        DbHelperSQL.ExecuteSql(strSQL);//因经常会无法更新到状态,固在此重复更新一次


        strSQL = "SELECT wx_result FROM MES_SB_WX WHERE wx_dh='" + wx_dh + "'  ";
        DataTable tbl = DbHelperSQL.Query(strSQL).Tables[0];

        if (tbl.Rows[0][0].ToString() == "需下模维修")
        {
            string str = "alert('维修结果为:需下模维修,请至电脑端进换模页面进行维护信息.');self.location='BXMonitor.aspx';";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", str, true);
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('确认成功.');self.location='BXMonitor.aspx';", true);
        }
    }
Ejemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop    = Request.QueryString["workshop"].ToString();
        _workorder   = Request.QueryString["workorder"].ToString();
        _workorder_f = Request.QueryString["workorder_f"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;

            //登入岗位的域
            string strsql_d    = "select * from [Mes_App_EmployeeLogin] with(nolock) where emp_code='" + lu.WorkCode + "' and on_date is not null and off_date is null";
            var    value_login = SQLHelper.reDs(strsql_d).Tables[0];
            string location    = "";
            if (value_login != null && value_login.Rows.Count > 0)
            {
                if (domain.Text == "100" || domain.Text == "")
                {
                    domain.Text = value_login.Rows[0]["domain"].ToString();
                }
                location = value_login.Rows[0]["location"].ToString();
            }

            //emp_code_name.Text = "02432何桂勤";
            //domain.Text = "200";

            workorder.Text = _workorder; workorder_f.Text = _workorder_f;
            init_data(_workorder, _workorder_f, location);
        }
    }
Ejemplo n.º 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            txt_emp.Text = lu.WorkCode + lu.UserName;
            domain.Text  = lu.Domain;

            //txt_emp.Text = "02274李晓根";
            //domain.Text = "200";

            setButton();

            ViewState["emp_login_sb"] = null;
        }
    }
Ejemplo n.º 23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        _need_no = Request.QueryString["need_no"].ToString();

        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            //emp_code_name.Text = "02432何桂勤";

            need_no.Text = _need_no;
            init_data(_need_no);

            lk_lotno_qad_Click(sender, e);
        }
    }
Ejemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _workshop = Request.QueryString["workshop"].ToString();

        if (WeiXin.GetCookie("workcode") == null)
        {
            Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>");
            return;
        }

        _workorder = Request.QueryString["workorder"].ToString();
        _next      = Request.QueryString["next"].ToString();//N表示第一次链接进来,Y表示点击 下一次 进来的
        if (!IsPostBack)
        {
            LoginUser lu = (LoginUser)WeiXin.GetJsonCookie();
            emp_code_name.Text = lu.WorkCode + lu.UserName;
            domain.Text        = lu.Domain;

            //emp_code_name.Text = "02432何桂勤";
            //domain.Text = "200";

            workorder.Text = _workorder;
            init_data(_workorder);
            bind_reason(domain.Text);
            bind_dcl_rea(domain.Text);

            if (_next == "Y")
            {
                //绑定数据
                string sql = @"select * from [MES_APP_WorkOrder_Ng_Deal_Main_temp] where workorder='{0}'";
                sql = string.Format(sql, _workorder);
                DataTable dt = SQLHelper.Query(sql).Tables[0];
                if (dt.Rows[0]["cz_result"].ToString() == "废品")
                {
                    b_result1.Checked = true;
                }
                if (dt.Rows[0]["cz_result"].ToString() == "待处理")
                {
                    b_result2.Checked     = true;
                    hege_qty.Text         = dt.Rows[0]["hege_qty"].ToString();
                    dcl_rea.SelectedValue = dt.Rows[0]["reason_code"].ToString();
                    dcl_rea.Visible       = false;
                    txt_dcl_rea.Text      = dt.Rows[0]["reason_code"].ToString() + "-" + dt.Rows[0]["reason"].ToString();
                    txt_dcl_rea.Visible   = true;
                }
                //设定只读
                b_result1.Disabled = true;
                b_result2.Disabled = true;
                hege_qty.ReadOnly  = true;

                GetData(_workorder);
            }
            else//若是第一次进来,需要确认 已处置数量不为0的话,需要赋值,且只读
            {
                string sql = @"select * from [Mes_App_WorkOrder_Ng] where workorder='{0}'";
                sql = string.Format(sql, _workorder);
                DataTable dt = SQLHelper.Query(sql).Tables[0];
                if (dt.Rows[0]["result"].ToString() == "废品")
                {
                    b_result1.Checked = true;
                    hege_qty.ReadOnly = true;
                }
                if (dt.Rows[0]["result"].ToString() == "待处理")
                {
                    b_result2.Checked     = true;
                    dcl_rea.SelectedValue = dt.Rows[0]["reason_code"].ToString();
                    dcl_rea.Visible       = false;
                    txt_dcl_rea.Text      = dt.Rows[0]["reason_code"].ToString() + "-" + dt.Rows[0]["reason"].ToString();
                    txt_dcl_rea.Visible   = true;
                }
                if (dt.Rows[0]["result"].ToString() != "")
                {
                    //设定只读
                    b_result1.Disabled = true;
                    b_result2.Disabled = true;
                }
            }
        }
    }