Exemplo n.º 1
0
        private void refreshOrderList()
        {
            order_backButton.Visible     = false;
            order_refreshButton.Visible  = false;
            order_refreshButton.Size     = new Size(123, 85);
            order_refreshButton.Location = new Point(173, 499);

            order_goButton.Visible = false;
            finishButton.Visible   = false;

            backButton.Visible    = true;
            refreshButton.Visible = true;
            goButton.Visible      = true;

            string url      = ArchiDox.Properties.Resources.ordersURL;
            string postData = "orders=all";
            string orders   = Global.SendData("POST", url, postData);

            if (orders.Length > 0)
            {
                try
                {
                    JsonResponseOrdersResult responseObj = JsonConvert.DeserializeObject <JsonResponseOrdersResult>(orders);
                    ordersBuffer = responseObj.content;

                    if (responseObj.status == "OK")
                    {
                        try
                        {
                            ordersList.DataSource    = responseObj.content;
                            ordersList.DisplayMember = "display_name";
                            ordersList.ValueMember   = "id";
                            orderDetailsList.Visible = false;
                            ordersList.Visible       = true;
                            code.Visible             = false;

                            Console.Error.Flush();
                        }
                        catch (Exception ex)
                        {
                            Console.Error.WriteLine(ex.Message);
                            Console.Error.WriteLine(ex.StackTrace);
                            Console.Error.Flush();
                        }
                    }
                }
                catch (Exception ex)
                {
                    string message = ex.Message;
                    Console.Error.WriteLine(message);
                    Console.Error.Flush();
                }
            }
            else
            {
                ordersList.DataSource = null;
                ordersList.Items.Add("Brak danych");
            }
        }
Exemplo n.º 2
0
        public SearchForm()
        {
            this.wndMsg    = new SearchWndMessageWindow(this);
            this.appStart  = DateTime.Now;
            this.app_path  = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            this.fn        = app_path + @"\logs\orders_log-" + appStart.ToString("yyyyMMdd") + ".log";
            this.errStream = new StreamWriter(fn, true);
            string url      = ArchiDox.Properties.Resources.ordersURL;
            string postData = "orders=all";
            string orders   = this.SendData("POST", url, postData);

            Console.SetError(this.errStream);
            Console.Error.WriteLine(orders);
            Console.Error.Flush();

            if (orders.Length > 0)
            {
                try
                {
                    JsonResponseOrdersResult responseObj = JsonConvert.DeserializeObject <JsonResponseOrdersResult>(orders);
                    ordersBuffer = responseObj.content;

                    if (responseObj.status == "OK")
                    {
                        try
                        {
                            InitializeComponent();
                            ordersList.DataSource    = responseObj.content;
                            ordersList.DisplayMember = "display_name";
                            ordersList.ValueMember   = "id";
                            orderDetailsList.Visible = false;
                            ordersList.Visible       = true;
                            Console.Error.Flush();
                        }
                        catch (Exception ex)
                        {
                            Console.Error.WriteLine(ex.Message);
                            Console.Error.WriteLine(ex.StackTrace);
                            Console.Error.Flush();
                            throw;
                        }
                    }
                }
                catch (Exception ex)
                {
                    string message = ex.Message;
                    Console.Error.WriteLine(message);
                    Console.Error.Flush();
                }
            }
            else
            {
                ordersList.DataSource = null;
                ordersList.Items.Add("Brak danych");
            }
            this.listLoaded = true;
        }
Exemplo n.º 3
0
        private void refreshOrdersList()
        {
            this.statusLabel.Visible = false;
            string url      = ArchiDox.Properties.Resources.ordersAcceptURL;
            string postData = "orders=all";
            string orders   = Global.SendData("POST", url, postData);

            Console.Error.WriteLine(orders);
            Console.Error.Flush();

            if (orders.Length > 0)
            {
                try
                {
                    JsonResponseOrdersResult responseObj = JsonConvert.DeserializeObject <JsonResponseOrdersResult>(orders);
                    ordersBuffer = responseObj.content;

                    if (responseObj.status == "OK")
                    {
                        try
                        {
                            ordersList.DataSource    = responseObj.content;
                            ordersList.DisplayMember = "display_name";
                            ordersList.ValueMember   = "id";

                            ordersList.Visible = true;


                            Console.Error.Flush();
                        }
                        catch (Exception ex)
                        {
                            Console.Error.WriteLine(ex.Message);
                            Console.Error.WriteLine(ex.StackTrace);
                            Console.Error.Flush();
                            throw;
                        }
                    }
                }
                catch (Exception ex)
                {
                    string message = ex.Message;
                    Console.Error.WriteLine(message);
                    Console.Error.Flush();
                }
            }
            else
            {
                ordersList.DataSource = null;
                ordersList.Items.Add("Brak danych");
            }
            this.listLoaded = true;
        }
Exemplo n.º 4
0
        public CustomerReceptionForm()
        {
            Console.SetError(Global.errStream);
            Console.Error.WriteLine("Reception form initilized");

            InitializeComponent();
            Global.current_form = this;

            order_backButton.Click    += new System.EventHandler(this.backToOrders);
            order_refreshButton.Click += new System.EventHandler(this.refreshOrdersListEvent);
            order_goButton.Click      += new System.EventHandler(this.pinVerify);


            string url      = ArchiDox.Properties.Resources.ordersAcceptURL;
            string postData = "orders=all";
            string orders   = Global.SendData("POST", url, postData);

            Console.SetError(Global.errStream);
            Console.Error.WriteLine(orders);
            Console.Error.Flush();

            if (orders.Length > 0)
            {
                try
                {
                    JsonResponseOrdersResult responseObj = JsonConvert.DeserializeObject <JsonResponseOrdersResult>(orders);
                    ordersBuffer = responseObj.content;

                    if (responseObj.status == "OK")
                    {
                        try
                        {
                            ordersList.DataSource    = responseObj.content;
                            ordersList.DisplayMember = "display_name";
                            ordersList.ValueMember   = "id";

                            ordersList.Visible = true;


                            Console.Error.Flush();
                        }
                        catch (Exception ex)
                        {
                            Console.Error.WriteLine(ex.Message);
                            Console.Error.WriteLine(ex.StackTrace);
                            Console.Error.Flush();
                            throw;
                        }
                    }
                }
                catch (Exception ex)
                {
                    string message = ex.Message;
                    Console.Error.WriteLine(message);
                    Console.Error.Flush();
                }
            }
            else
            {
                ordersList.DataSource = null;
                ordersList.Items.Add("Brak danych");
            }
            this.listLoaded = true;
        }
Exemplo n.º 5
0
        public SearchForm()
        {
            InitializeComponent();

            Global.current_form         = this;
            order_backButton.Visible    = false;
            order_refreshButton.Visible = false;
            order_goButton.Visible      = false;

            backButton.Visible    = true;
            refreshButton.Visible = true;
            goButton.Visible      = true;


            this.wndMsg = new SearchWndMessageWindow(this);
            string url      = ArchiDox.Properties.Resources.ordersURL;
            string postData = "orders=all";
            string orders   = Global.SendData("POST", url, postData);

            Console.SetError(Global.errStream);
            Console.Error.WriteLine(orders);
            Console.Error.Flush();



            if (orders.Length > 0)
            {
                try
                {
                    JsonResponseOrdersResult responseObj = JsonConvert.DeserializeObject <JsonResponseOrdersResult>(orders);
                    ordersBuffer = responseObj.content;

                    if (responseObj.status == "OK")
                    {
                        try
                        {
                            ordersList.DataSource    = responseObj.content;
                            ordersList.DisplayMember = "display_name";
                            ordersList.ValueMember   = "id";
                            orderDetailsList.Visible = false;
                            ordersList.Visible       = true;

                            finishButton.Click  += new System.EventHandler(this.finishOrder);
                            backButton.Click    += new System.EventHandler(this.exitApp);
                            refreshButton.Click += new System.EventHandler(this.refreshOrderListEvent);
                            goButton.Click      += new System.EventHandler(this.showDetails);

                            order_backButton.Click    += new System.EventHandler(this.refreshOrderListEvent);
                            order_refreshButton.Click += new System.EventHandler(this.refreshDetails);
                            order_goButton.Click      += new System.EventHandler(this.scanBox);

                            Console.Error.Flush();
                        }
                        catch (Exception ex)
                        {
                            Console.Error.WriteLine(ex.Message);
                            Console.Error.WriteLine(ex.StackTrace);
                            Console.Error.Flush();
                            throw;
                        }
                    }
                }
                catch (Exception ex)
                {
                    string message = ex.Message;
                    Console.Error.WriteLine(message);
                    Console.Error.Flush();
                }
            }
            else
            {
                ordersList.DataSource = null;
                ordersList.Items.Add("Brak danych");
            }
            this.listLoaded = true;
        }