Пример #1
0
        private void butAddMapArea_Click(object sender, EventArgs e)
        {
            //edit this entry
            if (gridEmployees.SelectedIndices == null ||
                gridEmployees.SelectedIndices.Length <= 0 ||
                gridEmployees.Rows[gridEmployees.SelectedIndices[0]].Tag == null ||
                !(gridEmployees.Rows[gridEmployees.SelectedIndices[0]].Tag is Employee))
            {
                MsgBox.Show(this, "Select an employee");
                return;
            }
            Employee        employee = (Employee)gridEmployees.Rows[gridEmployees.SelectedIndices[0]].Tag;
            FormMapAreaEdit FormEP   = new FormMapAreaEdit();

            FormEP.MapItem                     = new MapArea();
            FormEP.MapItem.IsNew               = true;
            FormEP.MapItem.Width               = 6;
            FormEP.MapItem.Height              = 6;
            FormEP.MapItem.ItemType            = MapItemType.Room;
            FormEP.MapItem.Extension           = employee.PhoneExt;
            FormEP.MapItem.Description         = "";
            FormEP.MapItem.MapAreaContainerNum = _mapCur.MapAreaContainerNum;
            if (FormEP.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            FillMap();
        }
Пример #2
0
		private void MapAreaDisplayLabelControl_DoubleClick(object sender,System.EventArgs e) {
			if(!AllowEdit) {
				return;
			}
			//edit this display label
			FormMapAreaEdit FormEP=new FormMapAreaEdit();
			FormEP.MapItem=this.MapAreaItem;
			if(FormEP.ShowDialog(this)!=DialogResult.OK) {
				return;
			}
			if(MapAreaDisplayLabelChanged!=null) { //let anyone interested know that this display label was edited
				MapAreaDisplayLabelChanged(this,new EventArgs());
			}
		}
Пример #3
0
 private void MapAreaRoomControl_DoubleClick(object sender,EventArgs e)
 {
     if(!AllowEdit) {
         return;
     }
     //edit this room
     FormMapAreaEdit FormEP=new FormMapAreaEdit();
     FormEP.MapItem=this.MapAreaItem;
     if(FormEP.ShowDialog(this)!=DialogResult.OK) {
         return;
     }
     if(MapAreaRoomChanged!=null) { //let anyone interested know that this cubicle was edited
         MapAreaRoomChanged(this,new EventArgs());
     }
 }
Пример #4
0
        private void newLabelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormMapAreaEdit FormEP = new FormMapAreaEdit();

            FormEP.MapItem          = new MapArea();
            FormEP.MapItem.IsNew    = true;
            FormEP.MapItem.Width    = 6;
            FormEP.MapItem.Height   = 6;
            FormEP.MapItem.ItemType = MapItemType.DisplayLabel;
            PointF xy = GetXYFromMenuLocation(sender);

            FormEP.MapItem.XPos = Math.Round(xy.X, 3);
            FormEP.MapItem.YPos = Math.Round(xy.Y, 3);
            if (FormEP.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            mapAreaPanel_MapAreaChanged(this, new EventArgs());
        }
Пример #5
0
        private void MapAreaDisplayLabelControl_DoubleClick(object sender, System.EventArgs e)
        {
            if (!AllowEdit)
            {
                return;
            }
            //edit this display label
            FormMapAreaEdit FormEP = new FormMapAreaEdit();

            FormEP.MapItem = this.MapAreaItem;
            if (FormEP.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            if (MapAreaDisplayLabelChanged != null)            //let anyone interested know that this display label was edited
            {
                MapAreaDisplayLabelChanged(this, new EventArgs());
            }
        }
Пример #6
0
        private void newCubicleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormMapAreaEdit FormEP = new FormMapAreaEdit();

            FormEP.MapItem          = new MapArea();
            FormEP.MapItem.IsNew    = true;
            FormEP.MapItem.Width    = 6;
            FormEP.MapItem.Height   = 6;
            FormEP.MapItem.ItemType = MapItemType.Room;
            PointF xy = GetXYFromMenuLocation(sender);

            FormEP.MapItem.XPos = Math.Round(xy.X, 3);
            FormEP.MapItem.YPos = Math.Round(xy.Y, 3);
            FormEP.MapItem.MapAreaContainerNum = _mapCur.MapAreaContainerNum;
            if (FormEP.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            FillMap();
        }
Пример #7
0
		private void butAddMapArea_Click(object sender,EventArgs e) {
			//edit this entry
			if(gridEmployees.SelectedIndices==null
				|| gridEmployees.SelectedIndices.Length<=0
				|| gridEmployees.Rows[gridEmployees.SelectedIndices[0]].Tag==null 
				|| !(gridEmployees.Rows[gridEmployees.SelectedIndices[0]].Tag is Employee)) {
				MsgBox.Show(this,"Select an employee");
				return;
			}
			Employee employee=(Employee)gridEmployees.Rows[gridEmployees.SelectedIndices[0]].Tag;
			FormMapAreaEdit FormEP=new FormMapAreaEdit();
			FormEP.MapItem=new MapArea();
			FormEP.MapItem.IsNew=true;
			FormEP.MapItem.Width=6;
			FormEP.MapItem.Height=6;
			FormEP.MapItem.ItemType=MapItemType.Room;
			FormEP.MapItem.Extension=employee.PhoneExt;
			FormEP.MapItem.Description="";
			if(FormEP.ShowDialog(this)!=DialogResult.OK) {
				return;
			}
			mapAreaPanel_MapAreaChanged(this,new EventArgs());
		}
Пример #8
0
		private void newLabelToolStripMenuItem_Click(object sender,EventArgs e) {
			FormMapAreaEdit FormEP=new FormMapAreaEdit();
			FormEP.MapItem=new MapArea();
			FormEP.MapItem.IsNew=true;
			FormEP.MapItem.Width=6;
			FormEP.MapItem.Height=6;
			FormEP.MapItem.ItemType=MapItemType.DisplayLabel;
			PointF xy=GetXYFromMenuLocation(sender);
			FormEP.MapItem.XPos=Math.Round(xy.X,3);
			FormEP.MapItem.YPos=Math.Round(xy.Y,3);
			if(FormEP.ShowDialog(this)!=DialogResult.OK) {
				return;
			}
			mapAreaPanel_MapAreaChanged(this,new EventArgs());
		}