Ejemplo n.º 1
0
        private void insertDetails()
        {
            string repairnumber = textrename.Text; //ASSIGNING THE VALUES
            string repairid     = textreid.Text;
            string repairamount = textreamount.Text;

            if (Mode == true)
            {
                sql = "insert into DETAILS_OF_REPAIRES (renumber,reid,reamount)values(@repairnumber, @repairid, @repairamount)";
                con.Open();
                cmd = new SqlCommand(sql, con);

                cmd.Parameters.AddWithValue("@repairnumber", repairnumber);
                cmd.Parameters.AddWithValue("@repairid", repairid);
                cmd.Parameters.AddWithValue("@repairamount", repairamount);
                cmd.ExecuteNonQuery();

                sql = "insert into PROFIT (repair_id , amount_for_repaires )values(@repairid, @repairamount)";

                cmd = new SqlCommand(sql, con);

                cmd.Parameters.AddWithValue("@repairid", repairid);
                cmd.Parameters.AddWithValue("@repairamount", repairamount);
                cmd.ExecuteNonQuery();
            }
            else
            {
            }

            con.Close();

            this.Hide();
            ProfitManagement10 p10 = new ProfitManagement10();

            p10.Show();
        }