Beispiel #1
0
 public void Add(ref classes.Building item)
 {
     DAL_DB.Building buildingDB = Mapper.Map <DAL_DB.Building>(item);
     context.Building.Add(buildingDB);
     context.SaveChanges();
     item.ObjectID = buildingDB.ObjectID;
 }
Beispiel #2
0
 public void Update(classes.Building building)
 {
     DAL_DB.Building buildingDB = context.Building.First(bld => bld.ObjectID == building.ObjectID);
     buildingDB.NameOfTheObject     = building.NameOfTheObject;
     buildingDB.IssueDate           = building.IssueDate;
     buildingDB.Length              = building.Length;
     buildingDB.Width               = building.Width;
     buildingDB.Height              = building.Height;
     buildingDB.Amount              = building.Amount;
     buildingDB.IsCivil             = building.IsCivil;
     buildingDB.IsPreserved         = building.IsPreserved;
     buildingDB.IsWhileConstruction = building.IsWhileConstruction;
     buildingDB.IsMultistory        = building.IsMultistory;
     buildingDB.StoreyHeight        = building.StoreyHeight;
     buildingDB.PrimalCoefficient   = building.PrimalCoefficient;
     buildingDB.CostOfTheObject     = building.CostOfTheObject;
     buildingDB.InvNumber           = building.InvNumber;
     context.SaveChanges();
 }