Example #1
0
        public static void TermekBovites(TermekBovites t)
        {
            SqlTransaction tr = con.BeginTransaction();

            try
            {
                cmd = new SqlCommand("INSERT INTO[TermekBovites](IdUserBovitet, IdTermek, BovitesDarab)Values(@idu, @idt,@db)", con);
                cmd.Parameters.Add(new SqlParameter("@idu", UserAzonosito));
                cmd.Parameters.Add(new SqlParameter("@idt", t.TermekID));
                cmd.Parameters.Add(new SqlParameter("@db", t.BovitesDarab));
                cmd.Transaction = tr;
                cmd.ExecuteNonQuery();


                SqlCommand cmd2 = new SqlCommand("INSERT INTO[TermekMozditasJelzes] (IdUserJelzet, IdTermek, JelMozdDarab, JelzetTipus) VALUES(@idus, @idter,@db,@tip)", con);
                cmd2.Parameters.Add(new SqlParameter("@idus", UserAzonosito));
                cmd2.Parameters.Add(new SqlParameter("@idter", t.TermekID));
                cmd2.Parameters.Add(new SqlParameter("@db", t.BovitesDarab));
                cmd2.Parameters.Add(new SqlParameter("@tip", JelzetTipus.TermekBovites));
                cmd2.Transaction = tr;
                cmd2.ExecuteNonQuery();

                tr.Commit();
            }
            catch (SqlException ex)
            {
                tr.Rollback();
                MessageBox.Show(ex.Message, "Hibás tranzakció termék mozdítás során !");
            }
        }
Example #2
0
 private void btnJelentes_Click(object sender, EventArgs e)
 {
     if (index == 1)
     {
         if (MessageBox.Show("Rossz termék jelentése elfogadása.", "Biztonság", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
         {
             termekRossz = new TermekRossz(termekID, cmbTermekValasztas.SelectedItem.ToString(), int.Parse(lbAr.Text), azonos, RosszTipus.RaktariTores, (int)numRosszTermekDarab.Value, DateTime.Today);
             // ABKezeloTermek.TermekRosszJelentes(termekRossz, index);
             MessageBox.Show("A rossz termék jelentve van !", "Információ", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else if (index == 2)
     {
         if (MessageBox.Show("Termék bővítés elfogadása.", "Biztonság", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
         {
             termekBovites = new TermekBovites(termekID, cmbTermekValasztas.SelectedItem.ToString(), int.Parse(lbAr.Text), (int)numRosszTermekDarab.Value, DateTime.Today);
             MessageBox.Show("A termék bővítést, továbbá termék mozgósításánál található !", "Információ", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else if (index == 3)
     {
         if (numJoTer.Value != 0)
         {
             if (MessageBox.Show("Rossz termék jelentés elfogadása.", "Biztonság", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
             {
                 termek.JelMozdDarab = (int)numJoTer.Value;
                 termekRossz         = new TermekRossz(termekID, cmbTermekValasztas.SelectedItem.ToString(), int.Parse(lbAr.Text), azonos, RosszTipus.RaktariTores, (int)numRosszTermekDarab.Value, DateTime.Today);
                 ABKezeloTermek.TermekRosszSzortirozas(termekRossz, termek);
             }
         }
         else
         {
             if (MessageBox.Show("Rossz termék jelentés elfogadása.", "Biztonság", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
             {
                 termekRossz = new TermekRossz(termekID, cmbTermekValasztas.SelectedItem.ToString(), int.Parse(lbAr.Text), azonos, RosszTipus.RaktariTores, (int)numRosszTermekDarab.Value, DateTime.Today);
                 ABKezeloTermek.TermekRosszSzortirozasTorles(termekRossz, termek);
             }
         }
     }
 }