Example #1
0
        private void ДокументToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            AddDoc f = new AddDoc();

            f.label4.Visible   = true;
            f.textBox3.Visible = true;
            f.ShowDialog();
            if (!f.sucsess)
            {
                return;
            }
            InsertQuery("update документ set номер_документа = " + Convert.ToInt32(f.textBox3.Text) + " , дата_документа = '" + f.dateTimePicker1.Value.Date.ToString("yyyyMMdd")
                        + "', тип = '" + f.textBox2.Text + "' where номер_документа = " + Convert.ToInt32(f.textBox3.Text) + ";");
        }
Example #2
0
        private void ДокументToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddDoc f = new AddDoc();

            f.ShowDialog();
            if (!f.sucsess)
            {
                return;
            }
            try
            {
                InsertQuery("insert into Документ values(" + Convert.ToInt32(f.textBox1.Text) + ",'" + f.dateTimePicker1.Value.Date.ToString("yyyyMMdd")
                            + "','" + f.textBox2.Text + "');");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка добавления");
            }
        }