コード例 #1
0
        private void button11_Click(object sender, EventArgs e)
        {
            string tripid     = texttripid.Text; //ASSIGNING THE VALUES
            string tripamount = texttripamout.Text;


            if (Mode == true)
            {
                sql = "insert into Enter_DETAILS_FOR_TRIPS (tripid,tripamount)values(@tripid , @tripamount)";
                con.Open();
                cmd = new SqlCommand(sql, con);

                cmd.Parameters.AddWithValue("@tripid", tripid);
                cmd.Parameters.AddWithValue("@tripamount", tripamount);
                cmd.ExecuteNonQuery();

                sql = "insert into PROFIT (trip_id , amount_for_trips)values(@tripid , @tripamount)";
                cmd = new SqlCommand(sql, con);

                cmd.Parameters.AddWithValue("@tripid", tripid);
                cmd.Parameters.AddWithValue("@tripamount", tripamount);
                cmd.ExecuteNonQuery();
            }
            else
            {
            }

            con.Close();

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

            p10.Show();
        }
コード例 #2
0
        private void button12_Click(object sender, EventArgs e)
        {
            this.Hide();
            ProfitManagement10 p10 = new ProfitManagement10();

            p10.Show();
        }
コード例 #3
0
ファイル: ProfitManagement12.cs プロジェクト: induwara99/ITP
        private void InsertID()
        {
            string fuelid     = textfuelid.Text; //ASSIGNING THE VALUES
            string fuelamount = textfuelamount.Text;


            if (Mode == true)
            {
                sql = "insert into DETAILS_FOR_FUEL (fuelid,fuelamount)values(@fuelid , @fuelamount)";
                con.Open();
                cmd = new SqlCommand(sql, con);

                cmd.Parameters.AddWithValue("@fuelid", fuelid);
                cmd.Parameters.AddWithValue("@fuelamount", fuelamount);
                cmd.ExecuteNonQuery();

                sql = "insert into PROFIT (fuel_id,amount_for_fuel)values(@fuelid , @fuelamount)";
                cmd = new SqlCommand(sql, con);

                cmd.Parameters.AddWithValue("@fuelid", fuelid);
                cmd.Parameters.AddWithValue("@fuelamount", fuelamount);
                cmd.ExecuteNonQuery();
            }
            else
            {
            }

            con.Close();

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

            p10.Show();
        }
コード例 #4
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();
        }