private static LocatorWarehouse getEntityByModel(LocatorWarehouseModel model, int count)
        {
            if (model == null) return null;

            LocatorWarehouse entity = new LocatorWarehouse();

            if (count == 0)
            {
                entity.CreateBy = AuthenticationHelper.UserId;
                entity.CreateDate = DateTime.Now;
            }
            else
            {
                entity.CreateBy = model.CreateBy;
                entity.CreateDate = model.CreateDate;
            }

            entity.EndDate = model.EndDate;
            entity.Id = model.Id;
            entity.LocatorId = model.LocatorId;
            entity.SOBId = model.SOBId;
            entity.StartDate = model.StartDate;
            entity.UpdateBy = AuthenticationHelper.UserId;
            entity.UpdateDate = DateTime.Now;
            entity.WarehouseId = model.WarehouseId;
            return entity;
        }
 public long Update(LocatorWarehouse entity)
 {
     LocatorWarehouse originalEntity = this.Context.LocatorWarehouses.Find(entity.Id);
     this.Context.Entry(originalEntity).CurrentValues.SetValues(entity);
     this.Context.Entry(originalEntity).State = EntityState.Modified;
     this.Commit();
     return entity.Id;
 }
 public LocatorWarehouseModel(LocatorWarehouse entity)
 {
     this.CreateBy = entity.CreateBy;
     this.CreateDate = entity.CreateDate;
     this.EndDate = entity.EndDate;
     this.Id = entity.Id;
     this.LocatorId = entity.LocatorId;
     this.SOBId = entity.SOBId;
     this.StartDate = entity.StartDate;
     this.UpdateBy = entity.UpdateBy;
     this.UpdateDate = entity.UpdateDate;
     this.WarehouseId = entity.WarehouseId;
 }
 public long Insert(LocatorWarehouse entity)
 {
     this.Context.LocatorWarehouses.Add(entity);
     this.Commit();
     return entity.Id;
 }
 public long Update(LocatorWarehouse entity)
 {
     return this.repository.Update(entity);
 }
 public long Insert(LocatorWarehouse entity)
 {
     return this.repository.Insert(entity);
 }