Пример #1
0
 public UnitOfWork(Magazyn2019Entities context)
 {
     _context            = context;
     CustomerRepository  = new CustomerRepository(_context);
     UserRepository      = new UserRepository(_context);
     WarehouseRepository = new WarehouseRepository(_context);
     GroupRepository     = new GroupRepository(_context);
     ProductRepository   = new ProductRepository(_context);
     MoveRepository      = new MoveRepository(_context);
     InventoryRepository = new InventoryRepository(_context);
 }
Пример #2
0
        /// <summary>
        /// 调价查询
        /// </summary>
        /// <param name="Status"></param>
        /// <param name="OrderNum"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public List <MoveOrder> GetMoveOrderList(int Status, string OrderNum, DateTime startTime, DateTime endTime)
        {
            var moveOrder = new MoveRepository();

            Expression <Func <MoveOrder, bool> > where = item => item.CreateTime >= startTime && item.CreateTime <= endTime && item.IsDelete != 1 && item.IsDelete != 1;
            if (Status != 0)
            {
                where = where.And(item => item.Status == Status);
            }
            if (!string.IsNullOrEmpty(OrderNum))
            {
                where = where.And(item => item.OrderNum.IndexOf(OrderNum) != -1);
            }
            return(moveOrder.GetMoveOrderList(where));
        }
Пример #3
0
 public UnitOfWork(PokebookContext _context, IMapper mapper)
 {
     context             = _context;
     Chats               = new ChatRepository(context, mapper);
     Messages            = new MessageRepository(context, mapper);
     UserChats           = new UserChatRepository(context, mapper);
     Users               = new UserRepository(context, mapper);
     Friendships         = new FriendshipRepository(context, mapper);
     Pokemons            = new PokemonRepository(context, mapper);
     PokemonCatches      = new PokemonCatchRepository(context, mapper);
     Types               = new TypeRepository(context, mapper);
     Moves               = new MoveRepository(context, mapper);
     PokemonUsers        = new PokemonUserRepository(context, mapper);
     PokemonTypes        = new PokemonTypeRepository(context, mapper);
     PokemonMoveCatches  = new PokemonMoveCatchRepository(context, mapper);
     PokemonMoves        = new PokemonMoveRepository(context, mapper);
     PokemonCatchDeleted = new PokemonCatchDeletedRepository(context, mapper);
 }
Пример #4
0
 public MoveController(ApplicationDbContext context)
 {
     _moveRepository = new MoveRepository(context);
 }
Пример #5
0
 public MovesController(PokebookContext dbc, IMapper m, MoveRepository repo, IHostingEnvironment hostingEnvironment) : base(dbc, m, repo)
 {
     _hostingEnvironment = hostingEnvironment;
 }
        static async System.Threading.Tasks.Task Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json");
            var config           = builder.Build();
            var connectionString = config.GetConnectionString("DefaultConnection");

            int pokemonSpeciesIndex;
            int moveIndex;
            int tableStartInt;

            try {
                tableStartInt       = Int32.Parse(args[0]);
                pokemonSpeciesIndex = Int32.Parse(args[1]);
                moveIndex           = Int32.Parse(args[2]);
            }
            catch (Exception)
            {
                using (var logger = LoggerDomain.GetLog(connectionString))
                {
                    logger.Error("Arguments must be set and be a integer");
                    throw new Exception("Arguments must be set and be a integer");
                }
            }

            var dbSession = new DbSession(config.GetConnectionString("DefaultConnection"));

            var typesRepository          = new TypeRepository(dbSession);
            var typesAdvantageRepository = new TypeAdvantageRepository(dbSession);
            var natureRepository         = new NatureRepository(dbSession);
            var pokemonSpeciesRepository = new PokemonSpeciesRepository(dbSession);
            var moveRepository           = new MoveRepository(dbSession);
            var apiUrl = config["apiURL"];

            var typeSeeds           = new TypesSeeds(typesRepository);
            var typeAdvantagesSeeds = new TypeAdvantagesSeeds(typesRepository, typesAdvantageRepository, apiUrl);
            var natureSeeds         = new NatureSeeds(natureRepository, apiUrl);
            var pokemonSpeciesSeeds = new PokemonSpeciesSeeds(pokemonSpeciesRepository, typesRepository, apiUrl, connectionString);
            var moveSeeds           = new MovesSeeds(moveRepository, typesRepository, apiUrl, connectionString);

            if (tableStartInt <= (int)TableEnum.Type)
            {
                typeSeeds.Seeds();
            }
            if (tableStartInt <= (int)TableEnum.TypeAdvantage)
            {
                await typeAdvantagesSeeds.SeedsAsync();
            }
            if (tableStartInt <= (int)TableEnum.Nature)
            {
                await natureSeeds.SeedsAsync();
            }
            if (tableStartInt <= (int)TableEnum.PokemonSpecies)
            {
                await pokemonSpeciesSeeds.SeedsAsync(pokemonSpeciesIndex);
            }
            if (tableStartInt <= (int)TableEnum.Move)
            {
                await moveSeeds.SeedsAsync(moveIndex);
            }
        }
Пример #7
0
        public string getpuzzle(int id)
        {
            MoveRepository database = new MoveRepository("creativepowercell.asuscomm.com", "Uporabnik", "FeriChess");

            return(database.GetPuzzle(id));
        } // http://wtharvey.com/m8n2.txt
Пример #8
0
        /// <summary>
        /// 修改移库
        /// </summary>
        /// <param name="moveOrder"></param>
        /// <returns></returns>
        public bool EditMove(MoveOrder moveOrder)
        {
            var moveOrderRes = new MoveRepository();

            return(moveOrderRes.EditMove(moveOrder));
        }
Пример #9
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public bool DeleteMove(int ID)
        {
            var moveOrder = new MoveRepository();

            return(moveOrder.DeleteMove(ID));
        }