public void CreateOrUpdate(RackContract rackContract) { var rack = RackRepository.Get(rackContract.Id); if (rack != null) { rack.RackParent = RackRepository.Get(rackContract.RackId); rack.Code = rackContract.Code; rack.Limit = rackContract.Limit; rack.Location = rackContract.Location; rack.Name = rackContract.Name; RackRepository.Update(rack); } else { rack = new Rack(); rack.RackParent = RackRepository.Get(rackContract.RackId); rack.Code = rackContract.Code; rack.Limit = rackContract.Limit; rack.Location = rackContract.Location; rack.Name = rackContract.Name; RackRepository.Insert(rack); } }
public void CreateAndUpdateRackItemLevel(RackContract rackContract) { var rack = IRackRepository.Get(rackContract.Id); if (rack != null) { rack.Code = rackContract.Code; rack.Name = rackContract.Name; rack.Limit = rackContract.Limit; rack.Location = rackContract.Location; rack.rack = IRackRepository.Get(rackContract.RackId); IRackRepository.Update(rack); } else { rack = new Rack(); rack.Name = rackContract.Name; rack.Limit = rackContract.Limit; rack.Location = rackContract.Location; rack.rack = IRackRepository.Get(rackContract.RackId); IRackRepository.Insert(rack); } }
public void CreateAndDelete(RackContract rackContract) { var rack = IRackRepository.Get(rackContract.Id); if (rack != null) { rack.Limit = rackContract.Limit; rack.Location = rackContract.Location; rack.Name = rackContract.Name; rack.Code = rackContract.Code; rack.Rack1 = IRackRepository.Get(rackContract.RackId); } else { Rack rack1 = new Rack(); rack1.Limit = rackContract.Limit; rack1.Location = rackContract.Location; rack1.Name = rackContract.Name; rack1.Code = rackContract.Code; rack1.Rack1 = IRackRepository.Get(rackContract.RackId); IRackRepository.Insert(rack1); } }
public void SaveCreateOrUpdate(RackContract rackContract) { var RackDB = IRackRepository.Get(rackContract.Id); if (RackDB != null) { RackDB.Code = rackContract.Code; RackDB.Limit = rackContract.Limit; RackDB.Location = rackContract.Location; RackDB.Name = rackContract.name; RackDB.Racks = IRackRepository.Get(rackContract.RackID); } else { Rack rack = new Rack(); rack.Code = rackContract.Code; rack.Limit = rackContract.Limit; rack.Location = rackContract.Location; rack.Name = rackContract.name; rack.Racks = IRackRepository.Get(rackContract.Id); IRackRepository.Insert(RackDB); } }
public void Delete(RackContract rackContract) { var rack = RackRepository.Get(rackContract.Id); RackRepository.Delete(rack); }