public ClassesController(Models.AppContext context)
 {
     db = context;
 }
 public UserVotesController(Models.AppContext context)
 {
     db = context;
 }
 public UserRepository(Models.AppContext appContext) : base(appContext)
 {
 }
 { public BookingRepository(Models.AppContext appContext) : base(appContext)
   {
   }
示例#5
0
 public HomeModel(Models.AppContext app)
 {
     this._context = app;
 }
示例#6
0
 public FlightRepository(Models.AppContext appContext) : base(appContext)
 {
 }
示例#7
0
 public UserController()
 {
     _context = new Models.AppContext();
 }
 public BegrotingController(Models.AppContext context)
 {
     _context = context;
 }
 public RepositoryBase(Models.AppContext appContext)
 {
     this.Context = appContext;
 }
示例#10
0
 public InkomstController(Models.AppContext context)
 {
     _context = context;
 }
示例#11
0
 public AfschrijvingController(Models.AppContext context)
 {
     _context = context;
 }
示例#12
0
 public MessagesController(Models.AppContext db, UserManager <User> userManager, SignInManager <User> signInManager)
 {
     _db            = db;
     _userManager   = userManager;
     _signInManager = signInManager;
 }
 public AccountController(Models.AppContext context)
 {
     db = context;
 }
 public VoteOptionsController(Models.AppContext context)
 {
     db = context;
 }
示例#15
0
 public TemplateUseModel(IOptions <Configuration.CloudStorage> cloudSettings, Models.AppContext app)
 {
     context             = app;
     azureFileController = new AzureFileController(cloudSettings.Value.ConnectionString, cloudSettings.Value.ReadString);
 }
示例#16
0
 public TicketService(Models.AppContext context)
 {
     _context = context;
 }
        public UsersController(Models.AppContext context)
        {
            _context = context;

            _context.Database.EnsureCreated();
        }
 public UserViewModel(Models.AppContext app)
 {
     context         = app;
     this.Breadcrumb = new LinkedList <Tuple <string, string> >();
     Breadcrumb.AddLast(Tuple.Create("Home", "/home"));
 }
示例#19
0
 public ContractController(Models.AppContext context)
 {
     _context = context;
 }
 public UserRepository(Models.AppContext db)
 {
     _db = db;
 }
示例#21
0
 public UserEventsController(Models.AppContext context)
 {
     db = context;
 }
示例#22
0
 public StorageController(Models.AppContext context, ILogger <StorageController> logger)
 {
     _context = context;
     _logger  = logger;
 }
        public ProductsV1_0Controller(Models.AppContext context)
        {
            _context = context;

            _context.Database.EnsureCreated();
        }
示例#24
0
 public ReserveringController(Models.AppContext context)
 {
     _context = context;
 }
示例#25
0
 public RekeningController(Models.AppContext context)
 {
     _context = context;
 }
示例#26
0
 public PicturesController(Models.AppContext context, RabbitMqPublisher rabbitMqPublisher)
 {
     _context           = context;
     _rabbitMqPublisher = rabbitMqPublisher;
 }
        /// <summary>
        /// Saves the shipment data to the Database. If it exists in DB, it is edited; else it's added.
        /// </summary>
        public void SaveShipmentToDB()
        {
            using (var db = new Models.AppContext())
            {
                //create shipment entity and set props
                Entities.Shipment entShipment = new Shipment()
                {
                    ShipmentId = Shipment.ShipmentID, Boxes = new List <ShipmentBox>(), ShipmentDate = Shipment.ShipmentDate
                };

                //add each box one to entShipment entity
                foreach (var box in Shipment.Boxes)
                {
                    ShipmentBox entBox = new ShipmentBox
                    {
                        BoxContentString = box.FBALabel(),
                        BoxNumber        = box.BoxNumber,
                        BoxId            = box.BoxID,
                        Shipment         = entShipment
                    };

                    entShipment.Boxes.Add(entBox);
                }//end foreach loop

                //get amazon warehouse entity and set to ShipmentEntity
                AmazonWarehouse amz = db.AmazonWarehouses.Where(a => a.Id == Shipment.FullfillmentShipTo.Id).FirstOrDefault();
                entShipment.ShipToCenter = amz;

                //get company address entity and set to shipmententity
                CompanyAddress comp = db.CompanyAddresses.Where(c => c.Id == Shipment.CompanyShipFrom.Id).FirstOrDefault();
                entShipment.ShipFromCenter = comp;

                //check if shipment exists in the database
                if (db.Shipments.Any(s => s.ShipmentId == Shipment.ShipmentID))
                {
                    Shipment shipmentDel = db.Shipments.Find(Shipment.ShipmentID);


                    var bx = db.Boxes.Where((b => b.Shipment.ShipmentId == shipmentDel.ShipmentId)).ToList();

                    for (int i = 0; i < bx.Count(); i++)
                    {
                        db.Boxes.Remove(bx[i]);
                    }


                    db.SaveChanges();

                    //then delete the shipment with shipmentID
                    db.Shipments.Remove(shipmentDel);

                    //finally add the shipment back into shipments table
                    db.Shipments.Add(entShipment);
                }
                else
                {
                    //add shipment to DB and save
                    db.Shipments.Add(entShipment);
                }


                db.SaveChanges();
            }
        }
示例#28
0
 public RepositoryWrapper(Models.AppContext appContext)
 {
     _appContext = appContext;
 }
示例#29
0
 public VerifyModel(Models.AppContext app)
 {
     _context = app;
 }
示例#30
0
 public NewsController(Models.AppContext context)
 {
     db = context;
 }