protected void Page_Load(object sender, EventArgs e)
        {
            Response.BufferOutput = true;
            Authentication auth = new Authentication(this);
            if (auth.LoadSession() == false)
            {
                auth.RemoveSession();
                Response.Redirect("../../UI/FrameUI/login.htm");
                Response.End();
            }
            else
            {
                m_perimission = ((Authentication.LOGININFO)Session["USERINFO"]).Permission;
                if (CheckAccessAble())
                {
                    if (!IsPostBack)
                    {
                        string req_id_ = Misc.GetHtmlRequestValue(Request, "id");
                        objid.Value = Misc.GetHtmlRequestValue(Request, "objid");
                        rowversion.Value = Misc.GetHtmlRequestValue(Request, "ver");

                        PkgRequisition m_req = new PkgRequisition(req_id_);

                        if (m_req.RequisitionId == "")
                        {
                            //this.ClientScript.RegisterStartupScript(this.GetType(), "refresh", "<script>alert('����δ�ҵ���');window.opener.__doPostBack('BtnQuery','');window.close();</script>");
                            Misc.Message(this.GetType(), ClientScript, "��������δ�ҵ���");
                            Misc.RegisterClientScript(this.GetType(), "opener_shx", ClientScript, "<script type='text/javascript'>window.opener.__doPostBack('BtnQuery','');window.close();</script>");
                            return;
                        }
                        else
                        {
                            if (m_req.RowState != "init")
                            {
                                //this.ClientScript.RegisterStartupScript(this.GetType(), "refresh", "<script>alert('����״̬�Ѹı䣬�����޸ģ�');window.opener.__doPostBack('BtnQuery','');window.close();</script>");
                                Misc.Message(this.GetType(), ClientScript, "����״̬�Ѹı䣬�����޸ġ�");
                                Misc.RegisterClientScript(this.GetType(), "opener_shx", ClientScript, "<script>window.opener.__doPostBack('BtnQuery','');window.close();</script>");
                            }
                            else
                            {
                                GenPkgPart m_pkg_part = new GenPkgPart(m_req.PackageNo, m_req.PartNo);

                                DdlProdSiteBind();
                                DdlReceiptDeptBind();
                                DdlReceiptPersonBind();

                                requisition_id.InnerText = m_req.RequisitionId;
                                project_id.InnerText = m_req.ProjectId;
                                project_desc.InnerText = m_pkg_part.ProjectName;
                                package_no.InnerText = m_req.PackageNo;
                                package_name.InnerText = m_req.PackageName;
                                part_no.InnerText = m_req.PartNo;
                                part_name.InnerText = m_req.PartNameE;
                                onhand_qty.InnerText = m_pkg_part.OnhandQty.ToString();
                                avai_qty.InnerText = Convert.ToString(m_pkg_part.AvaiQty + m_req.RequireQty);
                                reserved_qty.InnerText = Convert.ToString(m_pkg_part.ReservedQty - m_req.RequireQty);

                                DdlProdSite.SelectedIndex = DdlProdSite.Items.IndexOf(DdlProdSite.Items.FindByValue(m_req.PlaceId));
                                DdlReceiptDept.SelectedIndex = DdlReceiptDept.Items.IndexOf(DdlReceiptDept.Items.FindByValue(m_req.ReceiptDept));
                                TxtDate.Text = m_req.ReceiptDateStr;
                                DdlReceiptPerson.SelectedIndex = DdlReceiptPerson.Items.IndexOf(DdlReceiptPerson.Items.FindByText(m_req.Receiver));
                                TxtIC.Text = m_req.ReceiverIc;
                                TxtContact.Text = m_req.ReceiverContract;
                                TxtBlock.Text = m_req.ProjectBlock;
                                TxtSystem.Text = m_req.ProjectSystem;
                                ChkDz.Checked = m_req.Crance == "1" ? true : false;
                                ChkPS.Checked = m_req.Psflag == "1" ? true : false;
                                TxtRequireQty.Text = m_req.RequireQty.ToString();
                                TxtWorkContent.Text = m_req.WorkContent;
                            }
                        }
                    }
                }
                else
                {
                    auth.RemoveSession();
                    Response.Redirect("../../UI/FrameUI/login.htm");
                    Response.End();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.BufferOutput = true;
            Authentication auth = new Authentication(this);
            if (auth.LoadSession() == false)
            {
                auth.RemoveSession();
                Response.Redirect("../../UI/FrameUI/login.htm");
                Response.End();
            }
            else
            {
                m_perimission = ((Authentication.LOGININFO)Session["USERINFO"]).Permission;
                if (CheckAccessAble())
                {
                    if (!IsPostBack)
                    {
                        string id_ = Server.HtmlDecode(Misc.GetHtmlRequestValue(Request, "id"));
                        string objid_ = Misc.GetHtmlRequestValue(Request, "objid");
                        string rowversion_ = Server.HtmlDecode(Misc.GetHtmlRequestValue(Request, "ver"));
                        string packageNo_ = Server.HtmlDecode(Misc.GetHtmlRequestValue(Request, "pkg"));
                        string partNo_ = Server.HtmlDecode(Misc.GetHtmlRequestValue(Request, "part"));
                        decimal releaseQty_ = Convert.ToDecimal(Server.HtmlDecode(Misc.GetHtmlRequestValue(Request, "qty")));
                        decimal issueQty_ = Misc.DBStrToNumber(Server.HtmlDecode(Misc.GetHtmlRequestValue(Request, "iss")));

                        GenPkgPart pkg = new GenPkgPart(packageNo_, partNo_);

                        LblReqId.Text = id_;
                        LblPackageNo.Text = packageNo_;
                        LblPackageName.Text = pkg.PackageName;
                        LblPartNo.Text = partNo_;
                        LblPartName.Text = pkg.PartNameE;
                        LblPartSpec.Text = pkg.PartSpec;
                        LblReleasedQty.Text = releaseQty_.ToString();
                        LblIssuedQty.Text = issueQty_.ToString();

                        HiddenObjid.Value = objid_;
                        HiddenRowversion.Value = rowversion_;

                        GVDataDataBind(packageNo_, partNo_);
                    }
                }
                else
                {
                    auth.RemoveSession();
                    Response.Redirect("../../UI/FrameUI/login.htm");
                    Response.End();
                }
            }
        }
 private void PartDataBind()
 {
     GenPkgPart part_ = new GenPkgPart(TxtPkgNo.Text, TxtPartNo.Text);
     TxtProject.Text = part_.ProjectId;
     TxtPO.Text = part_.PoNo;
     TxtPkgName.Text = part_.PackageName;
     TxtPartName.Text = part_.PartName;
     TxtPartNameE.Text = part_.PartNameE;
     TxtPartSpec.Text = part_.PartSpec;
     TxtPartUnit.Text = part_.Unit;
     TxtOnHandQty.Text = part_.OnhandQty.ToString();
     TxtAvaiQty.Text = part_.AvaiQty.ToString();
 }