Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string   sCustomNumber = txtCustomNumber.Text.Trim();
            DateTime?dDateBeg;

            // проверки
            if (sCustomNumber.Length == 0)
            {
                RFMMessage.MessageBoxError("Не указан № ГТД...");
                txtCustomNumber.Select();
                return;
            }
            if (dtpDateBeg.IsEmpty)
            {
                RFMMessage.MessageBoxError("Не указана дата начала действия ГТД...");
                txtCustomNumber.Select();
                return;
            }
            else
            {
                dDateBeg = dtpDateBeg.Value.Date;
            }

            if (dgvData.Rows.Count == 0)
            {
                RFMMessage.MessageBoxError("Не выбрано ни одного товара...");
                return;
            }
            RFMCursorWait.Set(true);
            oGood.ClearError();
            oGood.SaveGoodCustom(sCustomNumber, dDateBeg, tGoodsCustoms);
            RFMCursorWait.Set(false);
            if (oGood.ErrorNumber == 0)
            {
                MotherForm.GotParam = new object[] { sCustomNumber };
                DialogResult        = DialogResult.Yes;
                Dispose();
            }
        }