Пример #1
0
        private void btnEditOffer_Click(object sender, EventArgs e)
        {
            try
            {
                if (FormHelper.IsGoodToGoOffer(labelDeviceId) == false)
                {
                    return;
                }

                ColumnView view         = gridControlOffers.MainView as ColumnView;
                int[]      selectedRows = gridViewOffers.GetSelectedRows();
                string     offerId;
                if (selectedRows.Length > 0)
                {
                    offerId = view.GetRowCellDisplayText(selectedRows[0], view.Columns["OfferId"]);
                    OfferConfig offerConf    = new OfferConfig(labelDeviceId.Text, int.Parse(offerId));
                    string      statusDevice = labelDeviceId.Text;

                    if (XtraDialog.Show(offerConf, $"Offer Configuration || { statusDevice}", MessageBoxButtons.OK) == DialogResult.OK)
                    {
                        FormHelper.LoadOffer(gridControlOffers, gridViewOffers);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #2
0
 private void btnAddOffer_Click(object sender, EventArgs e)
 {
     try
     {
         OfferConfig offerConf = new OfferConfig(labelDeviceId.Text);
         if (FormHelper.IsGoodToGoOffer(labelDeviceId) == false)
         {
             return;
         }
         string statusDevice = labelDeviceId.Text;
         if (XtraDialog.Show(offerConf, $"Offer Configuration || { statusDevice}", MessageBoxButtons.OK) == DialogResult.OK)
         {
             FormHelper.LoadOffer(gridControlOffers, gridViewOffers);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }