예제 #1
0
        private void bttOK_Click(object sender, EventArgs e)
        {
            if (txtCity.Text.Length > 0 && cboState.Text.Length > 0)
            {
                moLoc.City    = txtCity.Text;
                moLoc.StateID = ((RSLib.COListItem)cboState.SelectedItem).ID;

                if (mbFreeEdit == true)
                {
                    moLoc.Save();

                    string tmpLoc = moLoc.City + ", " + CBState.GetAbbrev(moLoc.StateID);

                    if (OnChangeLocation != null)
                    {
                        OnChangeLocation(moLoc.ID, "");
                    }
                }
                else
                {
                    string tmpLoc = moLoc.City + ", " + CBState.GetAbbrev(moLoc.StateID);

                    if (OnChangeLocation != null)
                    {
                        OnChangeLocation(moLoc.StateID, moLoc.City);
                    }
                }

                this.Close();
            }
        }
예제 #2
0
        void floc_OnAddLocation(int itmID, string description)
        {
            RSLib.COListItem li = new RSLib.COListItem();

            li.ID          = 0;
            li.Description = description + ", " + CBState.GetAbbrev(itmID);
            li.Meta        = itmID.ToString();
            li.Meta1       = description;

            lstLocations.Items.Add(li);

            mbItemChanged = true;
            SetSaveButtons();
        }
예제 #3
0
        void floc_OnChangeLocation(int itmID, string description)
        {
            RSLib.COListItem li = new RSLib.COListItem();

            li.ID          = ((RSLib.COListItem)lstLocations.SelectedItem).ID;
            li.Description = description + ", " + CBState.GetAbbrev(itmID);
            li.Meta        = itmID.ToString();
            li.Meta1       = description;

            //lstLocations.Items[lstLocations.SelectedIndex] = description + ", " + CBState.GetAbbrev(itmID);
            lstLocations.Items[lstLocations.SelectedIndex] = li;

            //((RSLib.COListItem)lstLocations.SelectedItem).Description = description + ", " + CBState.GetAbbrev(itmID);
            //((RSLib.COListItem)lstLocations.SelectedItem).Meta = itmID.ToString();
            //((RSLib.COListItem)lstLocations.SelectedItem).Meta1 = description;

            mbItemChanged = true;
            SetSaveButtons();
        }