protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            if (Session["Login"] == null)
            {
                Response.Redirect("../Exit.aspx");
                return;
            }

            string    strPVid = Request.QueryString["PVID"];
            string    strPDid = Request.QueryString["PDID"];
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);

            if (!IsPostBack)
            {
                this.txtProviderName.Enabled = false;
                if (strPVid == "" || strPVid == null || strPDid == "" || strPDid == null)
                {
                    this.btAdd.Enabled = true;
                    this.btMod.Enabled = false;
                    lbltitle.Text      = "新供应商资料录入";
                    this.FillDropDownList("AllMaterial", this.ddlProduct);
                    this.ddlProviderTime.Items.Add(new ListItem("及时", "0"));
                    this.ddlProviderTime.Items.Add(new ListItem("一般", "1"));
                    this.ddlProviderTime.Items.Add(new ListItem("不及时", "2"));
                    this.ddlProviderTime.SelectedIndex = 0;
                    this.ddlProviderQuality.Items.Add(new ListItem("好", "0"));
                    this.ddlProviderQuality.Items.Add(new ListItem("一般", "1"));
                    this.ddlProviderQuality.Items.Add(new ListItem("不好", "2"));
                    this.ddlProviderQuality.SelectedIndex = 0;
                }
                else
                {
                    this.btnFind.Enabled = false;
                    this.btAdd.Enabled   = false;
                    this.btMod.Enabled   = true;
                    this.FillDropDownList("AllMaterial", this.ddlProduct);
                    this.ddlProviderTime.Items.Add(new ListItem("及时", "0"));
                    this.ddlProviderTime.Items.Add(new ListItem("一般", "1"));
                    this.ddlProviderTime.Items.Add(new ListItem("不及时", "2"));
                    this.ddlProviderTime.SelectedIndex = 0;
                    this.ddlProviderQuality.Items.Add(new ListItem("好", "0"));
                    this.ddlProviderQuality.Items.Add(new ListItem("一般", "1"));
                    this.ddlProviderQuality.Items.Add(new ListItem("不好", "2"));
                    this.ddlProviderQuality.SelectedIndex = 0;

                    CMSMStruct.ProviderStruct ps1 = StoBusi.GetProviderDetailOne(strPVid, strPDid);
                    this.txtProviderCode.Text             = ps1.strProviderCode;
                    this.txtProviderName.Text             = ps1.strProviderName;
                    this.ddlProduct.SelectedIndex         = this.ddlProduct.Items.IndexOf(this.ddlProduct.Items.FindByText(ps1.strProductName));
                    this.txtProviderPrice.Text            = ps1.strProviderPrice;
                    this.txtProviderUnit.Text             = ps1.strProviderUnit;
                    this.ddlProviderTime.SelectedIndex    = this.ddlProviderTime.Items.IndexOf(this.ddlProviderTime.Items.FindByText(ps1.strProviderTime));
                    this.ddlProviderQuality.SelectedIndex = this.ddlProviderQuality.Items.IndexOf(this.ddlProviderQuality.Items.FindByText(ps1.strProviderQuality));
                    this.txtProviderValue.Text            = ps1.strProviderValue;
                    this.txtLinkName.Text        = ps1.strLinkName;
                    this.txtLinkPhone.Text       = ps1.strLinkPhone;
                    this.txtLinkAddress.Text     = ps1.strLinkAddress;
                    lbltitle.Text                = "供应商资料修改删除";
                    Session["psold"]             = ps1;
                    this.txtProviderCode.Enabled = false;
                    this.ddlProduct.Enabled      = false;
                }
            }
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            if (Session["Login"] == null)
            {
                Response.Redirect("../Exit.aspx");
                return;
            }

            string    strPVid = Request.QueryString["PVID"];
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);

            if (!IsPostBack)
            {
                this.btnFind.Visible = false;
                if (strPVid == "" || strPVid == null)
                {
                    this.btAdd.Enabled = true;
                    this.btMod.Enabled = false;
                    lbltitle.Text      = "新供应商档案录入";
                    this.ddlCredit.Items.Add(new ListItem("好", "0"));
                    this.ddlCredit.Items.Add(new ListItem("一般", "1"));
                    this.ddlCredit.Items.Add(new ListItem("不好", "2"));
                    this.ddlCredit.SelectedIndex = 0;
                    this.ddlActiveFlag.Items.Add(new ListItem("有效", "1"));
                    this.ddlActiveFlag.Items.Add(new ListItem("失效", "0"));
                    this.ddlActiveFlag.SelectedIndex = 0;
                    this.txtProviderCode.Text        = "P-----";
                    this.txtProviderCode.Enabled     = false;
                }
                else
                {
                    this.btnFind.Enabled = false;
                    this.btAdd.Enabled   = false;
                    this.btMod.Enabled   = true;
                    this.ddlCredit.Items.Add(new ListItem("好", "0"));
                    this.ddlCredit.Items.Add(new ListItem("一般", "1"));
                    this.ddlCredit.Items.Add(new ListItem("不好", "2"));
                    this.ddlCredit.SelectedIndex = 0;
                    this.ddlActiveFlag.Items.Add(new ListItem("有效", "1"));
                    this.ddlActiveFlag.Items.Add(new ListItem("失效", "0"));
                    this.ddlActiveFlag.SelectedIndex = 0;

                    CMSMStruct.ProviderStruct ps1 = StoBusi.GetProviderDetailOne(strPVid);
                    this.txtProviderCode.Text        = ps1.strPrvdCode;
                    this.txtProviderName.Text        = ps1.strPrvdName;
                    this.txtProviderAbbName.Text     = ps1.strPrvdAbbName;
                    this.ddlCredit.SelectedIndex     = this.ddlCredit.Items.IndexOf(this.ddlCredit.Items.FindByValue(ps1.strPrvdCredit));
                    this.txtQualification.Text       = ps1.strPrvdQualification;
                    this.ddlActiveFlag.SelectedIndex = this.ddlActiveFlag.Items.IndexOf(this.ddlActiveFlag.Items.FindByValue(ps1.strActiveFlag));
                    this.txtLinkName.Text            = ps1.strPrvdLinkName;
                    this.txtLinkPhone.Text           = ps1.strPrvdPhone;
                    this.txtFax.Text             = ps1.strPrvdFax;
                    this.txtEmail.Text           = ps1.strPrvdEmail;
                    this.txtPostCode.Text        = ps1.strPostCode;
                    this.txtAddress.Text         = ps1.strAddress;
                    lbltitle.Text                = "供应商档案修改";
                    Session["psold"]             = ps1;
                    this.txtProviderCode.Enabled = false;
                    this.txtProviderName.Enabled = false;
                }
            }
        }