private void DoBuyerPartList()
        {
            BUYER buyer = SessionManager.Buyer;

            uclPartList.BindBuyerPartList(SQMModelMgr.SelectBuyerSupPartList(entities, (decimal)SessionManager.ActiveCompany().COMPANY_ID, 0, buyer.BUYER_CODE));
            uclPartList.BuyerPartGrid.Columns[3].Visible = false;
        }
        private void SetupPage()
        {
            BUYER buyer = SessionManager.Buyer;

            lblViewBuyerTitle.Text += (" - " + buyer.BUYER_CODE);
            HiddenField hdCurrentActiveTab = (HiddenField)this.Form.Parent.FindControl("form1").FindControl("ContentPlaceHolder1").FindControl("hdCurrentActiveSecondaryTab");

            hdCurrentActiveTab.Value = SessionManager.CurrentAdminTab = "lbTrade";

            ddlUsers.Enabled           = false;
            lbSaveBuyerPerson1.Enabled = lbSaveBuyerPerson2.Enabled = false;
            SetUserList(false);

            DoBuyerPartList();
        }
        private void SetUserList(bool loadAll)
        {
            BUYER         buyer      = SessionManager.Buyer;
            List <PERSON> personList = null;

            if (loadAll)
            {
                personList = SQMModelMgr.SelectPersonList(SessionManager.ActiveCompany().COMPANY_ID, 0, false);
                foreach (PERSON person in personList)
                {
                    person.SSO_ID = person.FIRST_NAME + " " + person.LAST_NAME;
                }
            }
            else
            {
                PERSON person = SQMModelMgr.LookupPerson(entities, buyer.PERSON_ID, "", false);
                if (person != null)
                {
                    person.SSO_ID = person.FIRST_NAME + " " + person.LAST_NAME;
                    personList    = new List <PERSON>();
                    personList.Add(person);
                }
            }

            ddlUsers.DataSource     = personList;
            ddlUsers.DataTextField  = "SSO_ID";
            ddlUsers.DataValueField = "PERSON_ID";
            ddlUsers.DataBind();
            ddlUsers.Items.Insert(0, new ListItem("--- no user selected ---", "0"));

            if (buyer.PERSON_ID > 0)
            {
                ddlUsers.SelectedValue = buyer.PERSON_ID.ToString();
            }
            else
            {
                ddlUsers.SelectedValue = "0";
            }
        }