예제 #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 [psale] WHERE [psale].id_sale=" + id_coming;
                    cmd.ExecuteScalar();

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

                    sale_full uc = new sale_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();
                }
            }
        }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            sale_full uc = new sale_full();

            uc.Location = new Point(0, 30);
            uc.Size     = Size;
            this.Parent.Controls.Add(uc);
            this.Parent.Controls.RemoveAt(1);
        }
예제 #3
0
        private void продажиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (GetChildAtPoint(new Point(0, 30)) != null)
            {
                this.Controls.RemoveAt(1);
            }
            sale_full uc = new sale_full();

            uc.Location = new Point(0, 30);
            uc.Size     = Size - new Size(20, 70);
            this.Controls.Add(uc);
        }
예제 #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 [sale] SET date='" + Convert.ToString(DateTime.Now) + "' Where [sale].id=" + id_coming;
                        cmd.ExecuteScalar();

                        sale_full uc = new sale_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;
            }
        }