Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            using (SqlConnection con = new SqlConnection(@"Data source=.\SQLEXPRESS;Initial Catalog=I002_Solodkov;User ID=user;Password=Passw0rd;"))
            {
                try
                {
                    con.Open();
                    SqlCommand cmd = con.CreateCommand();
                    //заполнение данных
                    cmd.CommandText = "DELETE [pcoming] WHERE [pcoming].id_coming=" + id_coming;
                    cmd.ExecuteScalar();

                    cmd.CommandText = "DELETE [coming] WHERE [coming].id=" + id_coming;
                    cmd.ExecuteScalar();

                    coming_full uc = new coming_full();
                    uc.Location = new Point(0, 30);
                    uc.Size     = Size;
                    this.Parent.Controls.Add(uc);
                    this.Parent.Controls.RemoveAt(1);
                }
                catch (Exception ex)
                {
                    errol.Text    = "Ошибка записи";
                    errol.Visible = true;
                }
                finally
                {
                    con.Close();
                }
            }
        }
Esempio n. 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            coming_full uc = new coming_full();

            uc.Location = new Point(0, 30);
            uc.Size     = Size;
            this.Parent.Controls.Add(uc);
            this.Parent.Controls.RemoveAt(1);
        }
Esempio n. 3
0
        private void поставкаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (GetChildAtPoint(new Point(0, 30)) != null)
            {
                this.Controls.RemoveAt(1);
            }
            coming_full uc = new coming_full();

            uc.Location = new Point(0, 30);
            uc.Size     = Size - new Size(20, 70);
            this.Controls.Add(uc);
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox2.Text != "" && table.Rows.Count > 0)
            {
                using (SqlConnection con = new SqlConnection(@"Data source=.\SQLEXPRESS;Initial Catalog=I002_Solodkov;User ID=user;Password=Passw0rd;"))
                {
                    try
                    {
                        con.Open();
                        SqlCommand cmd = con.CreateCommand();
                        //заполнение данных

                        cmd.CommandText = "UPDATE [coming] SET date='" + Convert.ToString(DateTime.Now) + "' Where [coming].id=" + id_coming;
                        cmd.ExecuteScalar();

                        coming_full uc = new coming_full();
                        uc.Location = new Point(0, 30);
                        uc.Size     = Size;
                        this.Parent.Controls.Add(uc);
                        this.Parent.Controls.RemoveAt(1);
                    }
                    catch (Exception ex)
                    {
                        errol.Text    = "Ошибка записи";
                        errol.Visible = true;
                    }
                    finally
                    {
                        con.Close();
                    }
                }
            }
            else
            {
                errol.Text    = "Ошибка записи";
                errol.Visible = true;
            }
        }