Exemplo n.º 1
0
        private void EditData_Load(object sender, EventArgs e)
        {
            pnlControls.Controls.Clear();
            if (_pk > 0)
            {
                UserControl uc = null;
                switch (_dataType)
                {
                case ManagementDataType.Apartment:
                    uControlEditApartment ucA = new uControlEditApartment();
                    ucA.apartment = Apartment.Get(_pk);
                    uc            = ucA;
                    this.Text     = "Edit Apartment";
                    break;

                case ManagementDataType.Car:
                    uControlEditCar ucC = new uControlEditCar();
                    ucC.car   = Car.Get(_pk);
                    uc        = ucC;
                    this.Text = "Edit Car";
                    break;
                }
                if (uc != null)
                {
                    uc.Location = new Point(10, 10);
                    pnlControls.Controls.Add(uc);
                }
            }
        }