public DefRoom(Main M, Rooms_El_4 currRoom, EL_4 El4Ref) { this.currRoom = currRoom; this.EL4Ref = El4Ref; this.M = M; InitializeComponent(); }
private void NewObject_Click(object sender, EventArgs e) { Database.SetInitializer(new MigrateDatabaseToLatestVersion<NPLabDbContext, Configuration>()); //var db = new NPLabDbContext(); Objects obj = new Objects(); db.Object.Add(obj); db.SaveChanges(); Main M = new Main(obj.Id, this); M.Show(); M.Focus(); this.Hide(); }
public ImpRoom(Main M, Rooms currRoom, El_2 El2Ref, int sector, int floor, int room, bool isNew) { this.currRoom = currRoom; //this.currRoom.ListOfInstallations.Clear(); this.EL2Ref = El2Ref; this.M = M; this.sector = sector; this.floor = floor; this.room = room; this.isNew = isNew; InitializeComponent(); }
private void Load_Click(object sender, EventArgs e) { Database.SetInitializer(new MigrateDatabaseToLatestVersion<NPLabDbContext, Configuration>()); var db = new NPLabDbContext(); if (ListObjects.SelectedIndex == -1) { MessageBox.Show("Не сте избрали обект"); return; } int toLoad; try { toLoad = (from p in db.Object where p.ObjectName == ListObjects.SelectedItem.ToString() select p.Id).First(); } catch { MessageBox.Show("Грешка! Не съществува такъв обект"); return; } Main M = new Main(toLoad, H); M.Show(); M.Focus(); this.Close(); }
public EditProtectors(Main M) { this.M = M; InitializeComponent(); }