Beispiel #1
0
 public DefRoom(Main M, Rooms_El_4 currRoom, EL_4 El4Ref)
 {
     this.currRoom = currRoom;
     this.EL4Ref = El4Ref;
     this.M = M;
     InitializeComponent();
 }
Beispiel #2
0
 public void LoadDef(EL_4 e, bool clear)
 {
     EngineerNameDef.SelectedItem = e.NameOfEngineer;
     DefectiveProtectionDate.Value = e.Date;
     Mint.Value = System.Convert.ToDecimal(e.DTLowest);
     Maxt.Value = System.Convert.ToDecimal(e.DTHighest);
     MinIN.Value = System.Convert.ToDecimal(e.DNLowest);
     MaxIN.Value = System.Convert.ToDecimal(e.DNLowest);
     Normt.Value = System.Convert.ToDecimal(e.maxDT);
     NormIN.Value = System.Convert.ToDecimal(e.maxDN);
     if(clear) DefTreeView.Nodes.Clear();
     foreach (Sectors_El_4 sec in e.ListOfSectors)
     {
         DefTreeView.Nodes.Add(sec.SectorName);
         foreach (Floors_El_4 f in sec.ListOfFloors)
         {
             DefTreeView.Nodes[DefTreeView.Nodes.Count - 1].Nodes.Add(f.NameFloor);
             foreach (Rooms_El_4 r in f.ListOfRooms)
             {
                 DefTreeView.Nodes[DefTreeView.Nodes.Count - 1].Nodes[DefTreeView.Nodes[DefTreeView.Nodes.Count - 1].Nodes.Count - 1].Nodes.Add(r.RoomName);
             }
         }
     }
     tempDef = e;
 }
Beispiel #3
0
 public static void SaveEl_4(EL_4 e, int objId, NPLabDbContext db)
 {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion<NPLabDbContext, Configuration>());
     //var db = new NPLabDbContext();
     currObj = (from p in db.Object
                where p.Id == objId
                select p).FirstOrDefault();
     //currObj.El_4.Add(e);
     //db.Entry(e).State = System.Data.Entity.EntityState.Added;
     //foreach (Sectors_El_4 sec in e.ListOfSectors)
     //{
     //    db.Entry(sec).State = System.Data.Entity.EntityState.Added;
     //    foreach (Floors_El_4 f in sec.ListOfFloors)
     //    {
     //        db.Entry(f).State = System.Data.Entity.EntityState.Added;
     //        foreach (Rooms_El_4 r in f.ListOfRooms)
     //        {
     //            db.Entry(r).State = System.Data.Entity.EntityState.Added;
     //            foreach (Installation_El_4 inst in r.ListOfInstallations) db.Entry(inst).State = System.Data.Entity.EntityState.Added;
     //        }
     //    }
     //}
     //foreach (Cabel cab in e.ListOfCabels) db.Entry(cab).State = System.Data.Entity.EntityState.Added;
     db.SaveChanges();
 }
Beispiel #4
0
 public static void UpdateEl_4(EL_4 isol, DateTime date, int objId, NPLabDbContext db)
 {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion<NPLabDbContext, Configuration>());
     //var db = new NPLabDbContext();
     currObj = (from p in db.Object
                where p.Id == objId
                select p).FirstOrDefault();
     var curr = (from el in currObj.El_4
                 where el.Date == date
                 select el).FirstOrDefault();
     //curr = isol;
     //db.Entry(isol).State = System.Data.Entity.EntityState.Modified;
     //foreach (Cabel cab in isol.ListOfCabels) db.Entry(cab).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
 }
Beispiel #5
0
 public void LoadDef(EL_4 isol)
 {
 }