Exemplo n.º 1
0
        private void MouseClick(object sender, MouseEventArgs e)
        {
            var currentCell = (sender as RadGridView).CurrentCell;

            if (e.Button == MouseButtons.Right && currentCell.ColumnIndex == 0 && currentCell.RowIndex != -1)
            {
                bool isDelivered      = false;
                bool isDeliverToOther = false;
                var  order            = radGridView.Rows[currentCell.RowIndex].DataBoundItem as Order;
                if (order != null)
                {
                    selectedId  = order.Id;
                    isDelivered = string.Equals(order.Status, Constants.OrderStatusDelivered, StringComparison.InvariantCultureIgnoreCase);

                    if (!string.IsNullOrEmpty(order.Recipient) &&
                        !string.Equals(Constants.OrderReport2, order.IsSendNotification, StringComparison.InvariantCultureIgnoreCase) &&
                        string.Equals(Constants.OrderSms2, order.SendMessage, StringComparison.InvariantCultureIgnoreCase))
                    {
                        isDeliverToOther = true;
                    }
                }

                selectedRow = currentCell.RowIndex;

                var menu = AddMenu(isDelivered, isDeliverToOther);
                menu.Show(Cursor.Position.X, Cursor.Position.Y);
            }

            if (e.Button == MouseButtons.Left && currentCell.ColumnIndex == 4 && currentCell.RowIndex != -1)
            {
                var order = radGridView.Rows[currentCell.RowIndex].DataBoundItem as Order;

                if (order.DeliveryDetails != null && order.DeliveryDetails.Count > 0)
                {
                    int deliveryId = 0;
                    foreach (var detail in order.DeliveryDetails)
                    {
                        deliveryId = detail.DeliveryId.Value;
                    }

                    var parent = this.Parent as SplitterPanel;
                    parent.Controls.Clear();

                    var newDelivery = new DeliveryForm(deliveryId, currentUser)
                    {
                        Dock = DockStyle.Fill, TopLevel = false
                    };
                    parent.Controls.Add(newDelivery);
                    newDelivery.Show();

                    this.Close();
                }
            }
        }
Exemplo n.º 2
0
        private void NewItem(object sender, EventArgs e)
        {
            var parent = this.Parent as SplitterPanel;

            parent.Controls.Clear();

            var newDelivery = new DeliveryForm(currentUser)
            {
                Dock = DockStyle.Fill, TopLevel = false
            };

            parent.Controls.Add(newDelivery);
            newDelivery.Show();

            this.Close();
        }
Exemplo n.º 3
0
        public void UpdateSingleItem(object sender, EventArgs e)
        {
            if (selectedId > 0)
            {
                var parent = this.Parent as SplitterPanel;
                parent.Controls.Clear();

                var newDelivery = new DeliveryForm(selectedId, currentUser)
                {
                    Dock = DockStyle.Fill, TopLevel = false
                };
                parent.Controls.Add(newDelivery);
                newDelivery.Show();

                this.Close();
            }
        }
Exemplo n.º 4
0
        private void NewItem(object sender, EventArgs e)
        {
            var parent = this.Parent as SplitterPanel;

            parent.Controls.Clear();

            var newDelivery = new DeliveryForm(currentUser) { Dock = DockStyle.Fill, TopLevel = false };
            parent.Controls.Add(newDelivery);
            newDelivery.Show();

            this.Close();
        }
Exemplo n.º 5
0
        // Delivery functions
        public void UpdateSingleItem(object sender, EventArgs e)
        {
            if (selectedId > 0)
            {
                var parent = this.Parent as SplitterPanel;
                parent.Controls.Clear();

                var newDelivery = new DeliveryForm(selectedId, currentUser) { Dock = DockStyle.Fill, TopLevel = false };
                parent.Controls.Add(newDelivery);
                newDelivery.Show();

                this.Close();
            }
        }
Exemplo n.º 6
0
        private void MouseClick(object sender, MouseEventArgs e)
        {
            var currentCell = (sender as RadGridView).CurrentCell;

            if (e.Button == MouseButtons.Right && currentCell.ColumnIndex == 0 && currentCell.RowIndex != -1)
            {
                bool isDelivered = false;
                bool isDeliverToOther = false;
                var order = radGridView.Rows[currentCell.RowIndex].DataBoundItem as Order;
                if (order != null)
                {
                    selectedId = order.Id;
                    isDelivered = string.Equals(order.Status, Constants.OrderStatusDelivered, StringComparison.InvariantCultureIgnoreCase);

                    if (!string.IsNullOrEmpty(order.Recipient) &&
                        !string.Equals(Constants.OrderReport2, order.IsSendNotification, StringComparison.InvariantCultureIgnoreCase) &&
                        string.Equals(Constants.OrderSms2, order.SendMessage, StringComparison.InvariantCultureIgnoreCase))
                    {
                        isDeliverToOther = true;
                    }
                }

                selectedRow = currentCell.RowIndex;

                var menu = AddMenu(isDelivered, isDeliverToOther);
                menu.Show(Cursor.Position.X, Cursor.Position.Y);
            }

            if (e.Button == MouseButtons.Left && currentCell.ColumnIndex == 4 && currentCell.RowIndex != -1)
            {
                var order = radGridView.Rows[currentCell.RowIndex].DataBoundItem as Order;

                if (order.DeliveryDetails != null && order.DeliveryDetails.Count > 0)
                {
                    int deliveryId = 0;
                    foreach (var detail in order.DeliveryDetails)
                    {
                        deliveryId = detail.DeliveryId.Value;
                    }

                    var parent = this.Parent as SplitterPanel;
                    parent.Controls.Clear();

                    var newDelivery = new DeliveryForm(deliveryId, currentUser) { Dock = DockStyle.Fill, TopLevel = false };
                    parent.Controls.Add(newDelivery);
                    newDelivery.Show();

                    this.Close();
                }
            }
        }