public IShipmentMethodTypeState Get(string id) { IShipmentMethodTypeState state = CurrentSession.Get <ShipmentMethodTypeState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IShipmentMethodTypeState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IShipmentPackageContentMvoState Get(ShipmentPackageContentId id) { IShipmentPackageContentMvoState state = CurrentSession.Get <ShipmentPackageContentMvoState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IShipmentPackageContentMvoState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public ActionResult Index() { Movie movie = CurrentSession.Get <Movie>("selectedMovie"); if (movie == null) { return(View(directorManager.List())); } return(View(movie.Directors)); }
public IInOutState Get(string id) { IInOutState state = CurrentSession.Get <InOutState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IInOutState>(state, new Type[] { typeof(ISaveable) }, _readOnlyPropertyNames)); } return(state); }
public IDamageReasonState Get(string id) { IDamageReasonState state = CurrentSession.Get <DamageReasonState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IDamageReasonState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IAttributeSetInstanceState Get(string id) { IAttributeSetInstanceState state = CurrentSession.Get <AttributeSetInstanceState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IAttributeSetInstanceState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public ActionResult WatcParameters(WatchParameters watchParameters) { if (watchParameters != null) { CurrentSession.Set <WatchParameters>("WatchParameter", watchParameters); var nesne = CurrentSession.Get <WatchParameters>("WatchParameter"); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); }
public TradeReadModel GetByIdAndTraderId(string traderId, string tradeId) { TradeReadModel model = CurrentSession.Get <TradeReadModel>(tradeId); if (model.BuyTraderId == traderId || model.SellTraderId == traderId) { return(model); } throw new InvalidOperationException("Not Authorized"); }
public IPicklistItemMvoState Get(PicklistBinPicklistItemId id) { IPicklistItemMvoState state = CurrentSession.Get <PicklistItemMvoState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IPicklistItemMvoState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IGoodIdentificationMvoState Get(ProductGoodIdentificationId id) { IGoodIdentificationMvoState state = CurrentSession.Get <GoodIdentificationMvoState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IGoodIdentificationMvoState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IOrderShipmentState Get(OrderShipmentId id) { IOrderShipmentState state = CurrentSession.Get <OrderShipmentState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IOrderShipmentState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IUomConversionState Get(UomConversionId id) { IUomConversionState state = CurrentSession.Get <UomConversionState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IUomConversionState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public OrderReadModel GetOrderById(TraderId traderId, OrderId orderId) { OrderReadModel model = CurrentSession.Get <OrderReadModel>(orderId.Id); if (model.TraderId.Equals(traderId.Id, StringComparison.InvariantCultureIgnoreCase)) { return(model); } return(null); }
public IProductCategoryState Get(string id) { IProductCategoryState state = CurrentSession.Get <ProductCategoryState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IProductCategoryState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IInventoryItemRequirementEntryMvoState Get(InventoryItemRequirementEntryId id) { IInventoryItemRequirementEntryMvoState state = CurrentSession.Get <InventoryItemRequirementEntryMvoState>(id); if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IInventoryItemRequirementEntryMvoState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IUomTypeState Get(string id, bool nullAllowed) { IUomTypeState state = CurrentSession.Get <UomTypeState> (id); if (!nullAllowed && state == null) { state = new UomTypeState(); (state as UomTypeState).UomTypeId = id; } return(state); }
public ISellableInventoryItemState Get(InventoryItemId id, bool nullAllowed) { ISellableInventoryItemState state = CurrentSession.Get <SellableInventoryItemState> (id); if (!nullAllowed && state == null) { state = new SellableInventoryItemState(); (state as SellableInventoryItemState).SellableInventoryItemId = id; } return(state); }
public IInventoryPRTriggeredState Get(InventoryPRTriggeredId id, bool nullAllowed) { IInventoryPRTriggeredState state = CurrentSession.Get <InventoryPRTriggeredState> (id); if (!nullAllowed && state == null) { state = new InventoryPRTriggeredState(); (state as InventoryPRTriggeredState).InventoryPRTriggeredId = id; } return(state); }
public IDamageHandlingMethodState Get(string id, bool nullAllowed) { IDamageHandlingMethodState state = CurrentSession.Get <DamageHandlingMethodState> (id); if (!nullAllowed && state == null) { state = new DamageHandlingMethodState(); (state as DamageHandlingMethodState).DamageHandlingMethodId = id; } return(state); }
public Cart GetCart() { Cart cartToCheck = CurrentSession.Get <Cart>("cart"); if (cartToCheck == null) { CurrentSession.Set("cart", new Cart()); cartToCheck = CurrentSession.Get <Cart>("cart"); } return(cartToCheck); }
public IStatusItemState Get(string id, bool nullAllowed) { IStatusItemState state = CurrentSession.Get <StatusItemState> (id); if (!nullAllowed && state == null) { state = new StatusItemState(); (state as StatusItemState).StatusId = id; } return(state); }
public IMovementTypeState Get(string id, bool nullAllowed) { IMovementTypeState state = CurrentSession.Get <MovementTypeState> (id); if (!nullAllowed && state == null) { state = new MovementTypeState(); (state as MovementTypeState).MovementTypeId = id; } return(state); }
public IInventoryItemRequirementEntryState Get(InventoryItemRequirementEntryId id, bool nullAllowed) { IInventoryItemRequirementEntryState state = CurrentSession.Get <InventoryItemRequirementEntryState>(id); if (!nullAllowed && state == null) { state = new InventoryItemRequirementEntryState(); (state as InventoryItemRequirementEntryState).InventoryItemRequirementEntryId = id; } return(state); }
/// <summary> /// Get entity specified by <paramref name="id"/> directly from the database using the <see cref="CurrentSession"/> /// </summary> /// <remarks> /// The entity retrieved from the database will be attached to the <see cref="CurrentSession"/> /// </remarks> /// <exception cref="InvalidOperationException">where entity is already in the <see cref="CurrentSession"/></exception> public static T GetFromDb <T>(Guid id) { if (ExistsInSession <T>(id)) { const string msg = "Entity requested you want to Get from the database is already in the NHibernate session. To get the entity from the database you must first clear the session"; throw new InvalidOperationException(msg); } return(CurrentSession.Get <T>(id)); }
public ActionResult Klone(List <int> Groups) { if (permissionUser.SysAdmin == false) { if (permissionUser.Grup_Islemleri == (int)SecurityCode.Sadece_Izleme || permissionUser.Grup_Islemleri == (int)SecurityCode.Yetkisiz) { throw new Exception("Bu işlem için yetkiniz yok!"); } } if (Groups != null) { var GroupKlone = CurrentSession.Get <GroupsDetailNew>("Klone"); if (GroupKlone == null) { throw new Exception("Klonlanacak Grup Bulunamadı!"); } else { var ListGroup = _groupsDetailNewService.GetAllGroupsDetailNew(x => x.Panel_No == GroupKlone.Panel_No && x.Seri_No == GroupKlone.Seri_No && x.Grup_No == GroupKlone.Grup_No); foreach (var item in Groups) { foreach (var liste in ListGroup) { GroupsDetailNew groupsDetailNew = new GroupsDetailNew { Grup_No = item, Seri_No = liste.Seri_No, Panel_No = liste.Panel_No, Grup_Adi = _groupsDetailNewService.GetById(item).Grup_Adi, Kapi_Aktif = liste.Kapi_Aktif, Panel_Adi = liste.Panel_Adi, Asansor_Grup_No = liste.Asansor_Grup_No, Global_Bolge_No = liste.Global_Bolge_No, Kapi_No = liste.Kapi_No, Zaman_Grup_No = liste.Zaman_Grup_No }; var entity = _groupsDetailNewService.GetBy_GrupNo_AND_PanelID(groupsDetailNew.Grup_No, (short)groupsDetailNew.Panel_No); if (entity == null) { _groupsDetailNewService.AddGroupsDetailNew(groupsDetailNew); } else { _groupsDetailNewService.DeleteGroupsDetailNew(entity); _groupsDetailNewService.AddGroupsDetailNew(groupsDetailNew); } } } } } CurrentSession.Remove("Klone"); return(RedirectToAction("Groups", "AccessGroup")); }
public User GetUserById(int id) { User user = CurrentSession.Get <User>(id); if (user != null) { if (user.Deleted) { throw new ArgumentException("The user doesnot exist or have been deleted"); } return(user); } return(null); }
public ActionResult DeleteConfirmed(int id) { Category category = categoryManager.Find(I => I.Id == id); Movie movie = CurrentSession.Get <Movie>("selectedMovie"); if (movie != null) { movie.Categories.Remove(category); categoryManager.Save(); return(RedirectToAction("Index")); } categoryManager.Delete(category); return(RedirectToAction("Index")); }
public IOrderItemMvoState Get(OrderItemId id, bool nullAllowed) { IOrderItemMvoState state = CurrentSession.Get <OrderItemMvoState> (id); if (!nullAllowed && state == null) { state = new OrderItemMvoState(); (state as OrderItemMvoState).OrderItemId = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IOrderItemMvoState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IRoleTypeState Get(string id, bool nullAllowed) { IRoleTypeState state = CurrentSession.Get <RoleTypeState> (id); if (!nullAllowed && state == null) { state = new RoleTypeState(); (state as RoleTypeState).RoleTypeId = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IRoleTypeState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public IMovementLineMvoState Get(MovementLineId id, bool nullAllowed) { IMovementLineMvoState state = CurrentSession.Get <MovementLineMvoState> (id); if (!nullAllowed && state == null) { state = new MovementLineMvoState(); (state as MovementLineMvoState).MovementLineId = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IMovementLineMvoState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }