Example #1
0
        // This method gets called by the runtime. Use this method to add services to the container.

        public void ConfigureServices(IServiceCollection services)
        {
            // trimite prin massTransit rabbitMQ   publish-subscribe


            var bus = Bus.Factory.CreateUsingRabbitMq(sbc =>
            {
                var host = sbc.Host(new Uri("amqp://*****:*****@dove.rmq.cloudamqp.com/nqfmkaew"), h =>
                {
                    h.Username("nqfmkaew");
                    h.Password("nIrU1GP9_2-AppQNTD8jzvynPPqvHWIR");
                });
            });


            bus.Start();



            ///////adaug serviciul dedicat din repository
            var repo = new FeedbackRepo(bus);

            services.AddSingleton <IBus>(bus);

            services.AddSingleton <IFeedbackRepo>(repo);
            services.AddScoped <IService, Service>();

            services.AddControllersWithViews();
        }
        public void TestEventDetailsForFeedbackPage()
        {
            string   expectedEventName = "Bags of Joy Distribution";
            var      controller        = new FeedbackRepo(_Context);
            Feedback result            = controller.EventDetailsForFeedbackPage("EVNT00047261", 273690, 1);

            Assert.Equal(expectedEventName, result.EventName);
        }
Example #3
0
        public static FeedbackRepo GetFeedbackRepo()
        {
            if (feedbackRepo == null)
            {
                feedbackRepo = new FeedbackRepo();
            }

            return(feedbackRepo);
        }
Example #4
0
        // This method gets called by the runtime. Use this method to add services to the container.

        public void ConfigureServices(IServiceCollection services)
        {
            // trimite prin massTransit rabbitMQ   publish-subscribe

            var bus = Bus.Factory.CreateUsingRabbitMq(cfg =>
            {
                //host config
                var host = cfg.Host(new Uri("amqp://*****:*****@dove.rmq.cloudamqp.com/nqfmkaew"), h =>
                {
                    h.Username("nqfmkaew");
                    h.Password("nIrU1GP9_2-AppQNTD8jzvynPPqvHWIR");
                });

                //queque config
                cfg.ReceiveEndpoint(host, "FeedbackQueque1", e =>
                {
                    e.Consumer <MessageConsumer>();

                    //e.Handler<Feedback>(context =>
                    //{
                    //    return Console.Out.WriteLineAsync($"Received: {context.Message.Text}");
                    //});
                }
                                    );
            });



            //var bus = Bus.Factory.CreateUsingRabbitMq(sbc =>
            //{
            //    var host = sbc.Host(new Uri("amqp://*****:*****@dove.rmq.cloudamqp.com/nqfmkaew"), h =>
            //    {
            //        h.Username("nqfmkaew");
            //        h.Password("nIrU1GP9_2-AppQNTD8jzvynPPqvHWIR");
            //    });


            //    sbc.ReceiveEndpoint(e =>
            //    {
            //        e.Consumer<MessageConsumer>();
            //    });
            //});



            bus.Start();



            ///////adaug serviciul dedicat din repository
            var repo = new FeedbackRepo();   //bus

            services.AddSingleton <IFeedbackRepo>(repo);


            services.AddControllersWithViews();
        }
Example #5
0
        public ActionResult Add(FeedbackViewModel model)
        {
            ResponseResult result = FeedbackRepo.Update(model);

            return(Json(new
            {
                success = result.Success,
                message = result.ErrorMessage,
                entity = result.Entity
            }, JsonRequestBehavior.AllowGet));
        }
Example #6
0
        public ActionResult Create(FeedbackViewModel model)
        {
            var userid = (long)Session["userid"];
            ResponResultViewModel respon = FeedbackRepo.Save(model, userid);

            return(Json(new
            {
                success = respon.Success,
                message = respon.Message,
                entity = respon.Entity
            }, JsonRequestBehavior.AllowGet));
        }
        public void TestSaveFeedback()
        {
            bool     IsSaved    = false;
            var      controller = new FeedbackRepo(_Context);
            Feedback saveObj    = new Feedback();

            saveObj.EmployeeId = 273690;
            int result = controller.Save(saveObj);

            if (result == 1)
            {
                IsSaved = true;
            }
            Assert.True(IsSaved);
        }
Example #8
0
        public UnitOfWork(GoldStreamerContext e, bool DropDB = false)
        {
            if (DropDB)
            {
                DropDatabase(e);
            }
            if (e != null)
            {
                entities = e;
            }
            else
            {
                entities = new GoldStreamerContext();
            }

            TraderRepo            = new TraderRepo <Trader>(this.entities);
            TradePricesRepo       = new TraderPricesRepo <TraderPrices>(this.entities);
            PriceViewerRepo       = new PricerRepo <Prices>(this.entities);
            BasketRepo            = new BasketRepo <Basket>(this.entities);
            BasketPricesRepo      = new BasketPricesRepo <BasketPrices>(this.entities);
            BasketTradersRepo     = new BasketTradersRepo <BasketTraders>(this.entities);
            TraderFavRepo         = new TraderFavRepo <TraderFavorites>(this.entities);
            FavorateListRepo      = new FavoriteListRepo <FavoriteList>(this.entities);
            UsersRepo             = new UsersRepo <Users>(this.entities);
            GovernorateRepo       = new GovernorateRepo(this.entities);
            CityRepo              = new CityRepo(this.entities);
            RegionRepo            = new RegionRepo(this.entities);
            RolePermissionRepo    = new RolePermissionRepo <RolePermission>(this.entities);
            FeedbackRepo          = new FeedbackRepo <Feedback>(this.entities);
            QuestionGroupRepo     = new QuestionGroupRepo <QuestionGroup>(this.entities);
            QuestionRepo          = new QuestionRepo <Question>(this.entities);
            SubscribeRepo         = new SubscribeRepo <Subscribe>(this.entities);
            NewsMainCategoryRepo  = new NewsMainCategoryRepo <NewsMainCategory>(this.entities);
            NewsCategoryRepo      = new NewsCategoryRepo <NewsCategory>(this.entities);
            NewsRepo              = new NewsRepo <News>(this.entities);
            GlobalPriceRepo       = new GlobalPriceRepo <GlobalPrice>(entities);
            TraderPricesChartRepo = new TraderPricesChartRepo <TraderPricesChart>(entities);
            DollarRepo            = new DollarRepo <Dollar>(entities);
        }
Example #9
0
 public void TestEventDetailsForFeedbackPage_Memory()
 {
     var      controller = new FeedbackRepo(_context);
     Feedback result     = controller.EventDetailsForFeedbackPage("EVNT00047261", 273690, 1);
 }
Example #10
0
 public ActionResult Add(long id)
 {
     return(View("Add", FeedbackRepo.ListDTD1(id)));
 }
Example #11
0
 public ActionResult Add1(long id)
 {
     return(PartialView("_Add1", FeedbackRepo.ListDTD(id)));
 }
Example #12
0
 public ActionResult ChooseDocument(long id)
 {
     return(PartialView("_ChooseDocument", FeedbackRepo.ListDT(id)));
 }
Example #13
0
 public ActionResult List()
 {
     return(PartialView("_List", FeedbackRepo.All()));
 }
Example #14
0
 public FeedbackController(FeedbackRepo fdb)
 {
     this.fdb = fdb;
 }
Example #15
0
 public FeedbackController(FeedbackRepo repo)
 {
     _repo = repo;
 }