Пример #1
0
        public GetMaterialView()
        {
            InitializeComponent();
            InitializeComponentCustomize();
            lastAssginedOrder  = DataDB.GetLastAssignedOrder();
            BtnLastEmail.Text += $"({lastAssginedOrder.Id})";
            BtnLastExcel.Text += $"({lastAssginedOrder.Id})";
            EmptyOrderLabel.Hide();
            this.MaximizeBox               = false;
            this.MinimizeBox               = false;
            this.FormBorderStyle           = FormBorderStyle.FixedSingle;
            Panel.Width                    = this.Width - 40;
            Panel.HorizontalScroll.Maximum = 0;
            Panel.AutoScroll               = false;
            Panel.VerticalScroll.Visible   = true;
            Panel.AutoScroll               = true;
            Panel.WrapContents             = false;

            ordersList = DataDB.GetPendingOrders();

            OrderIdInput.Focus();
            this.ActiveControl = OrderIdInput;
            shownOrdersList    = Util.CloneOrderList(ordersList);
            SetItemList();
        }
Пример #2
0
        private void SetItemList()
        {
            if (shownOrdersList.Count == 0)
            {
                EmptyOrderLabel.Show();
            }
            else
            {
                EmptyOrderLabel.Hide();
            }
            int index = 0;

            foreach (Order order in shownOrdersList)
            {
                string          orderId  = order.Id.ToString();
                FlowLayoutPanel flowItem = new FlowLayoutPanel
                {
                    FlowDirection = FlowDirection.LeftToRight
                };
                Btn btnByProduct = new Btn
                {
                    Width  = 50,
                    Height = 35,
                    Order  = order,
                    Text   = "Asignar"
                };
                Btn btnDeleteOrder = new Btn
                {
                    Width  = 50,
                    Height = 35,
                    Order  = order,
                    Text   = "Delete",
                    Index  = index
                };
                Btn btnPrint = new Btn
                {
                    Width  = 50,
                    Height = 35,
                    Order  = order,
                    Text   = "Print",
                    Index  = index
                };
                btnDeleteOrder.Click += BtnDeleteOrder_Click;
                btnByProduct.Click   += BtnByProduct_Click;
                btnPrint.Click       += BtnPrint_Click;
                Label info = new Label
                {
                    Text   = $"Order N° {orderId}",
                    Width  = 80,
                    Height = 40,
                    Font   = new System.Drawing.Font("Arial Narrow", 12, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)))
                };

                flowItem.Height = 40;
                flowItem.Width  = Panel.Width;
                flowItem.Name   = orderId;
                flowItem.Controls.Add(info);
                flowItem.Controls.Add(btnByProduct);
                flowItem.Controls.Add(btnDeleteOrder);
                flowItem.Controls.Add(btnPrint);
                Panel.Controls.Add(flowItem);
                index++;
            }
        }