예제 #1
0
        //Login page for a deliverer
        public ActionResult Index(DTO.Delivery_staff ds)
        {
            //Check if the user exists
            if (DSManager.isUserValid(ds))
            {
                HttpContext.Session.SetString("login", ds.login);

                var allDeliverer = DSManager.GetDelivery_staffs();

                //setting multiple variables in sessions, so that we can re-use them
                foreach (var deliverer in allDeliverer)
                {
                    if (ds.login == deliverer.login)
                    {
                        IdLog = deliverer.delivery_staff_Id;
                        HttpContext.Session.SetInt32("idDL", IdLog);
                        pseudo = deliverer.login;
                        HttpContext.Session.SetString("nameDL", pseudo);
                    }
                }

                //List of his order(s)
                return(RedirectToAction("Details", "DeliveryStaff", new { id = IdLog }));
            }
            else
            {
                //Login page
                return(View());
            }
        }
예제 #2
0
        public void InitForm()
        {
            try
            {
                dataManager = new DSManager(jmsServer, jmsUser, jmsPassword, cacheUpdateTimerInterval, msgFilter, msgFilter);
                dataManager.IncMessageCounter += new EventHandler(OnIncMessageCounter);

                dataSet = new DataSet();

                SummaryData         summaryDataTemplate = new SummaryData();
                IList <SummaryData> summaryList;
                summaryList = dataManager.DaoManager.CreateObjList <SummaryData>(summaryDataTemplate);
                string filterText = "";  //G
                summaryDataTable            = CollectionHelper.ConvertTo <SummaryData>(summaryList, filterText);
                summaryDataTable.PrimaryKey = new DataColumn[] { summaryDataTable.Columns["Id"] };

                dataSet.Tables.Add(summaryDataTable);

                dataManager.RegisterDataSet(ref dataSet);
                dataManager.RegisterGridControl(ref gridMain);
                dataManager.StartListening();

                gridMain.DataSource = dataSet.Tables["SummaryData"];
                gridMain.ForceInitialize();
            }
            catch (Exception error)
            {
                MessageBox.Show("Error:" + error.Message);
            }
        }
예제 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            dataManager = new DSManager("", "", "", 10, "", "");
            SummaryData summaryDataTemplate = new SummaryData();

            summaryDataTemplate.FinalApprovalFlag = "N";
            IList <SummaryData> summaryList = dataManager.DaoManager.CreateObjList <SummaryData>(summaryDataTemplate);
        }
예제 #4
0
        public static void Initialize()
        {
            try
            {
                var builder = new ConfigurationBuilder()
                              .SetBasePath(Directory.GetCurrentDirectory())
                              .AddJsonFile("appsettings.json");

                Configuration = builder.Build();

                var services = new ServiceCollection();

                services.AddOptions();

                services.Configure <Settings>(Configuration.GetSection("Settings"));

                services.AddSingleton <IStorageDatabase, MongoDatabase>();
                services.AddSingleton <IStorageDatabase, LiteDBDatabase>();

                services.AddSingleton <ICache, RedisCache>();

                services.AddSingleton(typeof(StorageManager));

                _serviceProvider = services.BuildServiceProvider();

                _dsManager = new DSManager();

                _processors = new List <MessageProcessor>();

                for (var x = 0; x < Environment.ProcessorCount; x++)
                {
                    _processors.Add(new MessageProcessor(_dsManager));
                }

                var busClient = BusClientFactory.CreateDefault <AdvancedMessageContext>();

                busClient.SubscribeAsync <byte[]>(SubscribeMethod);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
예제 #5
0
 public MessageProcessor(DSManager dsmanager)
 {
     _dsManager = dsmanager ?? throw new ArgumentNullException(nameof(dsmanager));
 }