Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string message = String.Empty;

            if (this.dgwInputDocument != null && this.dgwInputDocument.RowCount > 1)
            {
                var dlgResult = MessageBox.Show(this, "Сигурни ли сте, че искате да запишетe данните!", "",
                                                MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dlgResult == DialogResult.Yes)
                {
                    InputDocument inputDocument = InputDocumentMapper.ReadValues(this.dgwInputDocument, true);
                    if (inputDocument != null)
                    {
                        this.dgwInputDocument.Rows.Clear();
                        this.Close();
                    }
                    else
                    {
                        message = "Не сте попълнили задължителните полета!";
                    }
                }
            }
            else
            {
                message = "Няма добавени продукти!";
            }
            if (message != String.Empty)
            {
                MessageBox.Show(this, message, "",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Ejemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            InputDocument inputDocument = InputDocumentMapper.ReadValues(this.dgwInputDocument, true);

            if (inputDocument != null)
            {
                this.dgwInputDocument.Rows.Clear();
                this.Close();
            }
            else
            {
                MessageBox.Show(this, "Не сте попълнили задължителните полета!", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }