示例#1
0
        private void RefreshFloor(int id = 0)
        {
            if (currentFloor == null)
            {
                currentFloor = bridge.DownloadFloor(2);
            }
            else if (id == 0)
            {
                currentFloor = bridge.DownloadFloor(currentFloor.GetId());
            }
            else
            {
                currentFloor = bridge.DownloadFloor(id);
            }

            Scheme              = currentFloor.Scheme;
            OriginalScheme      = new Bitmap(currentFloor.Scheme);
            Floore_Scheme.Image = Scheme;
            DrawScheme();
            Floor_Name.Text = currentFloor.FloorName;
            floors          = Bridge.GiveValidFloor();
            RefreshAllUseableFloor();
            LB.Hide();
            RefreshAllFloorList();
        }
示例#2
0
        private void LB_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (LB.SelectedItem.ToString())
            {
            case empty:
            {
                LB.Hide();
                break;
            }

            case DeletePoint:
            {
                bridge.DeleteExhibitSpase(currentSpace.GetId());
                LB.Hide();
                RefreshFloor();
                break;
            }

            case AddExhibit:
            {
                SetExhibit SE = new SetExhibit(currentSpace.GetId());
                this.Hide();
                SE.ShowDialog();
                this.Show();
                RefreshFloor();
                break;
            }

            case ResetExhibit:
            {
                ResetExhibit RE = new ResetExhibit(currentSpace);
                this.Hide();
                RE.ShowDialog();
                this.Show();
                RefreshFloor();
                break;
            }

            default:
            {
                int id = GetSelectedItemID(LB.SelectedItem.ToString());
                if (id == -1)
                {
                    MessageBox.Show("Возникла ошибка!");
                }
                else
                {
                    Exponat exhib = new Exponat(new Exhibit(id), isAdmin);
                    this.Hide();
                    exhib.ShowDialog();
                    if (isAdmin)
                    {
                        RefreshFloor();
                    }
                    this.Show();
                }
                break;
            }
            }
        }
示例#3
0
        private void Floore_Scheme_MouseClick(object sender, MouseEventArgs e)
        {
            mainSpace = currentSpace;
            if (!isChange)
            {
                LB.Items.Clear();
                if (isManager)
                {
                    LB.Items.Add(DeletePoint);
                }
                if (currentSpace != null)
                {
                    LB.SetBounds(currentSpace.XCoord, currentSpace.YCoord, 150, 65);
                    for (int pos = 0; pos < currentSpace.GetExhibits().Count; pos++)
                    {
                        LB.Items.Add(currentSpace.GetExhibits()[pos].exhibit_name);
                    }
                    if (isManager)
                    {
                        if (LB.Items.Count == 1)
                        {
                            LB.Items.Add(empty);
                        }
                    }
                    else
                    if (LB.Items.Count == 0)
                    {
                        LB.Items.Add(empty);
                    }

                    if (isManager)
                    {
                        LB.Items.Add(AddExhibit);
                        LB.Items.Add(ResetExhibit);
                    }

                    Scheme_Panel.Controls.Add(LB);
                    LB.Show();
                    LB.BringToFront();
                    System.Threading.Thread.Sleep(1000);
                }
                else
                {
                    LB.Hide();
                }
            }
            else
            {
                bridge.AddNewExhibitSpace(e.X, e.Y, currentFloor.GetId());
                CanselFunction();
                RefreshFloor();
            }
        }
示例#4
0
 public Client()
 {
     root      = 0;
     bridge    = new Bridge();
     isManager = false;
     isAdmin   = false;
     InitializeComponent();
     Cansel.Hide();
     LB.Hide();
     ManagerPanel.Hide();
     AdministratorPanel.Hide();
     RefreshAllUseableFloor();
     Scheme = new Bitmap(Floore_Scheme.Width, Floore_Scheme.Height);
     RefreshFloor();
 }