Пример #1
0
        /// <summary>
        /// This method is to load the search criteria object with values entered
        /// in the search criteria fields in the form
        /// </summary>
        private void loadLookupVendorSearchCriteria()
        {
            _lookupVendSearch = new LookupVendorSearchData();
            //If search type was Vendor Name
            if (_typeOfSearch == (int)VendorSearchCriteria.VENDORNAME)
            {
                if (_vendName != null && _vendName.Trim().Length != 0)
                {
                    _lookupVendSearch.VendName = _vendName;
                }
            }
            //search type was Vendor Tax ID
            else
            {
                if (_vendTaxID != null && _vendTaxID.Trim().Length != 0)
                {
                    _lookupVendSearch.TaxID = _vendTaxID;
                }
            }

            _lookupVendSearch.TypeOfSearch = _typeOfSearch;
        }
Пример #2
0
        private void CreateVendor_Load(object sender, EventArgs e)
        {
            this.NavControlBox.Owner = this;
            var gSess    = GlobalDataAccessor.Instance;
            var dSession = gSess.DesktopSession;

            strStoreNumber    = gSess.CurrentSiteId.StoreNumber;
            strUserId         = dSession.UserName;
            currentSearchData = dSession.LookupCriteria;

            if (dSession.ActiveVendor != null &&
                !dSession.ActiveVendor.NewVendor)
            {
                vendor = GlobalDataAccessor.Instance.DesktopSession.ActiveVendor;
                PopulateVendor(vendor);

                if (!vendor.CreationStore.Equals(gSess.CurrentSiteId.StoreNumber))
                {
                    vendInfoPanel.Enabled = false;
                    if (GlobalDataAccessor.Instance.DesktopSession.VenderFFLRequired)
                    {
                        corporateFFLLabel.Visible  = true;
                        customButtonSubmit.Enabled = false;
                    }
                    else
                    {
                        corporateFFLLabel.Visible = false;
                    }
                }
                else
                {
                    const string resourceName = "EDITVENDOR";
                    var          currUser     = GlobalDataAccessor.Instance.DesktopSession.LoggedInUserSecurityProfile;
                    if (!(SecurityProfileProcedures.CanUserViewResource(resourceName, currUser, dSession)))
                    {
                        vendInfoPanel.Enabled = false;
                    }
                }

                if (!(vendInfoPanel.Enabled))
                {
                    customButtonSubmit.Text = "Continue";

                    if (GlobalDataAccessor.Instance.DesktopSession.VenderFFLRequired && !Utilities.IsValidFFL(ffl.Text))
                    {
                        customButtonSubmit.Enabled = false;
                    }
                }
            }
            else if (GlobalDataAccessor.Instance.DesktopSession.VenderFFLRequired && GlobalDataAccessor.Instance.DesktopSession.ActiveVendor != null && CashlinxDesktopSession.Instance.ActiveVendor.NewVendor)
            {
                vendor = GlobalDataAccessor.Instance.DesktopSession.ActiveVendor;
                PopulateVendor(vendor);
            }
            else if (currentSearchData != null)
            {
                this.name.Text = currentSearchData.VendName;
                //this.taxID.Text = currentSearchData.TaxID;
                this.taxID.Enabled = false;
            }

            this.zipcode.stateChanging += this.state.dependentTextChanged;
            this.zipcode.cityChanging  += city.dependentTextChanged;

            this.name.Focus();
        }