public void CreateAndUpdateRackItemLevel(RackItemLevelContract rackItemLevelContract) { var rackitemlevel = irackItemLevelRepository.Get(rackItemLevelContract.Id); if (rackitemlevel != null) { rackitemlevel.CurrentQty = rackItemLevelContract.CurrentQty; rackitemlevel.InQty = rackItemLevelContract.InQty; rackitemlevel.OutQty = rackItemLevelContract.OutQty; rackitemlevel.Item1 = iiItemRepository.Get(rackItemLevelContract.ItemId); rackitemlevel.Rack1 = IRackRepository.Get(rackItemLevelContract.RackId); irackItemLevelRepository.Update(rackitemlevel); } else { RackItemLevel rackItemLevel = new RackItemLevel(); rackItemLevel.CurrentQty = rackItemLevelContract.CurrentQty; rackItemLevel.InQty = rackItemLevelContract.InQty; rackItemLevel.OutQty = rackItemLevelContract.OutQty; rackItemLevel.Item1 = iiItemRepository.Get(rackItemLevelContract.ItemId); rackItemLevel.Rack1 = IRackRepository.Get(rackItemLevelContract.RackId); irackItemLevelRepository.Insert(rackItemLevel); } }
public Guid GetRackItemLevelId() { using (ISession session = NhibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { var ItemId = GetItemId(); Item item = session.Get <Item>(ItemId); var RackId = GetRackId(); Rack rack = session.Get <Rack>(RackId); RackItemLevel rackItemLevel = new RackItemLevel { CurrentQuantity = 10, InQuantity = 5, OutQuantity = 10, Rack = rack, Item = item }; session.Save(rackItemLevel); transaction.Commit(); rackItemLevel = session.Get <RackItemLevel>(rackItemLevel.Id); return(rackItemLevel.Id); } } }
public void SaveCreateOrUpdate(RackItemLevelContract rackItemLevelContract) { var rackitemlevel = IRackItemLevelRepository.Get(rackItemLevelContract.Id); if (rackitemlevel != null) { rackitemlevel.CurrentQuantity = rackItemLevelContract.CurrentQuantity; rackitemlevel.InQuantity = rackItemLevelContract.InQuantity; rackitemlevel.OutQuantity = rackItemLevelContract.OutQuantity; rackitemlevel.Item = IItemRepository.Get(rackItemLevelContract.ItemId); rackitemlevel.Racks = IRackRepository.Get(rackItemLevelContract.RackId); IRackItemLevelRepository.Update(rackitemlevel); } else { rackitemlevel = new RackItemLevel(); rackitemlevel.CurrentQuantity = rackItemLevelContract.CurrentQuantity; rackitemlevel.InQuantity = rackItemLevelContract.InQuantity; rackitemlevel.OutQuantity = rackItemLevelContract.OutQuantity; rackitemlevel.Item = IItemRepository.Get(rackItemLevelContract.ItemId); rackitemlevel.Racks = IRackRepository.Get(rackItemLevelContract.RackId); IRackItemLevelRepository.Insert(rackitemlevel); } }
public Guid GetRackLevl() { using (var session = NhibernateLayer.OpenSession()) { using (var Transaction = session.BeginTransaction()) { ItemUnitTest itemtest = new ItemUnitTest(); RackUnitTest racktest = new RackUnitTest(); var item1 = itemtest.GetItem(); var rack1 = racktest.GetRack(); Item Item = session.Get <Item>(item1); Rack Rack = session.Get <Rack>(rack1); RackItemLevel RackItemLevel = new RackItemLevel() { CurrentQty = 6, InQty = 10, OutQty = 4, Item1 = Item, Rack1 = Rack }; session.Save(RackItemLevel); Transaction.Commit(); var Res = session.Get <RackItemLevel>(RackItemLevel.Id); return(Res.Id); } } }
public void TestRackItemLevel() { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { var IDItem = ItemId(); Item item = session.Get <Item>(IDItem); var IDRack = RackId(); Rack rack = session.Get <Rack>(IDItem); var rackItemLevel = new RackItemLevel { CurrentQuantity = "o1", InQuantity = "12", OutQuantity = "orderOne", Item = item, Rack = rack }; session.Save(rackItemLevel); transaction.Commit(); var result3 = session.Get <RackItemLevel>(rackItemLevel.Id); Assert.IsNotNull(session.Get <RackItemLevel>(rackItemLevel.Id)); Assert.AreEqual(rackItemLevel.Id, result3.Id); Assert.AreEqual(rackItemLevel.CurrentQuantity, result3.CurrentQuantity); Assert.AreEqual(rackItemLevel.InQuantity, result3.InQuantity); } } }
public void CreateAndUpdateRackItemLevel(RackItemLevelContract rackItemLevelContract) { var rackeitemlevel = IRackItemLevelRepository.Get(rackItemLevelContract.Id); if (rackeitemlevel != null) { //rackeitemlevel.Rack = rackItemLevelContract.RackId; rackeitemlevel.CurrentQuantity = rackItemLevelContract.CurrentQuantity; rackeitemlevel.InQuantity = rackItemLevelContract.InQuantity; rackeitemlevel.OutQuantity = rackItemLevelContract.OutQuantity; rackeitemlevel.Rack = RackRepository.Get(rackItemLevelContract.RackId); rackeitemlevel.Item = ItemRepository.Get(rackItemLevelContract.ItemId); IRackItemLevelRepository.Update(rackeitemlevel); } else { ///halallllllllllllllllllll boro bebnam rackeitemlevel = new RackItemLevel(); rackeitemlevel.CurrentQuantity = rackItemLevelContract.CurrentQuantity; rackeitemlevel.InQuantity = rackItemLevelContract.InQuantity; rackeitemlevel.OutQuantity = rackItemLevelContract.OutQuantity; IRackItemLevelRepository.Insert(rackeitemlevel); } }
public void SaveRackItemLevel() { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { var rackid = GetRackId(); Rack rack2 = session.Get <Rack>(rackid); var itemid = GetItemId(); Item item2 = session.Get <Item>(itemid); RackItemLevel ril1 = new RackItemLevel { Item = item2, Rack = rack2, CurrentQuantity = 50, InQuantity = 10, OutQuantity = 3 }; session.Save(ril1); transaction.Commit(); Assert.IsNotNull(session.Get <RackItemLevel>(ril1.Id)); } } }
public void CreateAndUpdateRackItemLevel(RackItemLevelContract rackItemLevelContract) { var rackitemLevel = IRackItemLevelRepository.Get(rackItemLevelContract.Id); if (rackitemLevel != null) { //save rackitemLevel.Item = IitemRepository.Get(rackItemLevelContract.ItemId); rackitemLevel.Rack = IRackRepository.Get(rackItemLevelContract.RackId); rackitemLevel.CurrentQuantity = rackItemLevelContract.CurrentQuantity; rackitemLevel.InQuantity = rackItemLevelContract.InQuantity; rackitemLevel.OutQuantity = rackItemLevelContract.OutQuantity; IRackItemLevelRepository.Update(rackitemLevel); } else { //creat rackitemLevel = new RackItemLevel(); rackitemLevel.Item = IitemRepository.Get(rackItemLevelContract.ItemId); rackitemLevel.Rack = IRackRepository.Get(rackItemLevelContract.RackId); rackitemLevel.CurrentQuantity = rackItemLevelContract.CurrentQuantity; rackitemLevel.InQuantity = rackItemLevelContract.InQuantity; rackitemLevel.OutQuantity = rackItemLevelContract.OutQuantity; IRackItemLevelRepository.Insert(rackitemLevel); } }
public void RackLevelTest() { using (var session = NhibernateLayer.OpenSession()) { using (var Transaction = session.BeginTransaction()) { var ID = GetRackLevl(); RackItemLevel rackItemLevel = session.Get <RackItemLevel>(ID); Assert.AreEqual(ID, rackItemLevel.Id); } } }
public void RackItemLevel() { using (ISession session = NhibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { var RackItemLevelId = GetRackItemLevelId(); RackItemLevel rackItemLevel = session.Get <RackItemLevel>(RackItemLevelId); transaction.Commit(); var result = session.Get <RackItemLevel>(rackItemLevel.Id); Assert.IsNotNull(result); } } }
public void Delete(RackItemLevel obj) { session.Delete(obj); }
public void Update(RackItemLevel obj) { session.Update(obj); }
public void Insert(RackItemLevel obj) { session.Save(obj); }