コード例 #1
0
        private void buttonOpen_Click(object sender, EventArgs e)
        {
            var worksheet = this.reoGridControlMain.Worksheets[0];

            try
            {
                int[] ids = Utilities.GetSelectedIDs(this.reoGridControlMain);
                if (ids.Length != 1)
                {
                    MessageBox.Show("请选择一项进行查看!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                int shipmentTicketID       = ids[0];
                var formShipmentTicketItem = new FormShipmentTicketItem(shipmentTicketID, this.projectID, this.warehouseID);
                formShipmentTicketItem.SetShipmentTicketStateChangedCallback(() =>
                {
                    this.Invoke(new Action(() =>
                    {
                        this.Search(true);
                    }));
                });
                formShipmentTicketItem.Show();
            }
            catch
            {
                MessageBox.Show("请选择一项进行查看", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }
コード例 #2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            var form = new FormShipmentTicketModify(this.projectID, this.warehouseID, this.userID);

            form.SetMode(FormMode.ADD);
            form.SetAddFinishedCallback((id, openTicket) =>
            {
                this.Search(false, id);
                if (openTicket == false)
                {
                    return;
                }
                var formShipmentTicketItem = new FormShipmentTicketItem(id, this.projectID, this.warehouseID);
                formShipmentTicketItem.SetShipmentTicketStateChangedCallback(() =>
                {
                    this.Invoke(new Action(() =>
                    {
                        this.Search();
                    }));
                });
                formShipmentTicketItem.Show();
            });
            form.Show();
        }