Exemplo n.º 1
0
        //-------------------------------------------------------------------
        // Synchronize the Entity & Building List with the Building ID passed in parameter
        //-------------------------------------------------------------------
        public void SynchronizeWithBuilding(Int64 ID)
        {
            RoomPicker_Building _bd = RoomPicker_Building.LoadByID(ID);
            RoomPicker_Entity   _en = RoomPicker_Entity.LoadByID(_bd.FK_ENTITY);

            treeList.Expand((from e in treeList.Objects.OfType <RoomPicker_Entity>().ToList() where e.ID == _en.ID select e).FirstOrDefault());
            treeList.SelectObject((from e in treeList.Objects.OfType <RoomPicker_Entity>().ToList() where e.ID == _en.ID select e).FirstOrDefault());

            treeList.Expand((from b in treeList.GetChildren(treeList.SelectedObject).OfType <RoomPicker_Building>().ToList() where b.ID == _bd.ID select b).FirstOrDefault());
            treeList.SelectObject((from b in treeList.GetChildren(treeList.SelectedObject).OfType <RoomPicker_Building>().ToList() where b.ID == _bd.ID select b).FirstOrDefault());
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------------
        // Synchronize the Entity & Building List with the Building ID passed in parameter
        //-------------------------------------------------------------------
        public void SynchronizeWithBuilding(Int64 ID)
        {
            RoomPicker_Building _bd = RoomPicker_Building.LoadByID(ID);

            fillEntity();
            _EntityID = _bd.FK_ENTITY;
            cbEntity.SelectedValue = _EntityID;

            fillBuilding();
            _BuildingID = ID;
            cbBuilding.SelectedValue = _BuildingID;
        }
Exemplo n.º 3
0
        public override void initForm(SynapseCore.Security.Tools.SecureAndTranslateMode Mode)
        {
            base.initForm(Mode);

            ckAvailable.Text = GetLabel("frmRoom.ckAvailable");

            if (!_RoomNameMandatory)
            {
                lbName.Visible = false;
                txName.Visible = false;
            }

            displayEntity();

            switch (_Mode)
            {
            case GlobalVariables.EditMode.New:
                //this.Text = this.Text + " - " + SynapseForm.GetLabel("global.Create");
                if (_PreSelectedEntity != 0)
                {
                    cbEntity.SelectedValue = _PreSelectedEntity;
                    cbBuilding.Select();
                }
                else
                {
                    cbEntity.SelectedIndex = -1;
                }
                if (_PreSelectedBuilding != 0)
                {
                    cbBuilding.SelectedValue = _PreSelectedBuilding;
                    txCode.Select();
                }
                else
                {
                    cbBuilding.SelectedIndex = -1;
                }

                txCode.Text         = "";
                txName.Text         = "";
                ckAvailable.Checked = true;
                break;

            case GlobalVariables.EditMode.Edit:
                _entity.dump();
                //this.Text = this.Text + " - " + SynapseForm.GetLabel("global.Edit");
                cbEntity.SelectedValue   = RoomPicker_Building.LoadByID(_entity.FK_BUILDING).FK_ENTITY;
                cbBuilding.SelectedValue = _entity.FK_BUILDING;
                txCode.Text         = _entity.CODE;
                txName.Text         = _entity.NAME;
                ckAvailable.Checked = _entity.AVAILABLE;
                break;
            }
        }
Exemplo n.º 4
0
        //-------------------------------------------------------------------
        // Synchronize the Entity, Building & Room List with the Room ID passed in parameter
        //-------------------------------------------------------------------
        public void SynchronizeWithRoom(Int64 ID)
        {
            RoomPicker_Room     _rm = RoomPicker_Room.LoadByID(ID);
            RoomPicker_Building _bd = RoomPicker_Building.LoadByID(_rm.FK_BUILDING);
            RoomPicker_Entity   _en = RoomPicker_Entity.LoadByID(_bd.FK_ENTITY);

            treeList.Expand((from e in treeList.Objects.OfType <RoomPicker_Entity>().ToList() where e.ID == _en.ID select e).FirstOrDefault());
            treeList.SelectObject((from e in treeList.Objects.OfType <RoomPicker_Entity>().ToList() where e.ID == _en.ID select e).FirstOrDefault());

            treeList.Expand((from b in treeList.GetChildren(treeList.SelectedObject).OfType <RoomPicker_Building>().ToList() where b.ID == _bd.ID select b).FirstOrDefault());
            treeList.SelectObject((from b in treeList.GetChildren(treeList.SelectedObject).OfType <RoomPicker_Building>().ToList() where b.ID == _bd.ID select b).FirstOrDefault());

            treeList.SelectObject((from r in treeList.GetChildren(treeList.SelectedObject).OfType <RoomPicker_Room>().ToList() where r.ID == _rm.ID select r).FirstOrDefault());

            //OnSelectionChanged(treeList, EventArgs.Empty);
        }
Exemplo n.º 5
0
        //-------------------------------------------------------------------
        // Synchronize the Entity, Building & Room List with the Room ID passed in parameter
        //-------------------------------------------------------------------
        public void SynchronizeWithRoom(Int64 ID)
        {
            RoomPicker_Room     _rm = RoomPicker_Room.LoadByID(ID);
            RoomPicker_Building _bd = RoomPicker_Building.LoadByID(_rm.FK_BUILDING);

            fillEntity();
            _EntityID = _bd.FK_ENTITY;
            cbEntity.SelectedValue = _EntityID;

            fillBuilding();
            _BuildingID = _bd.ID;
            cbBuilding.SelectedValue = _BuildingID;

            fillRoom(ID);
            _RoomID = ID;
        }