Пример #1
0
 private void bt_add_offer_Click(object sender, EventArgs e)
 {
     Forms.Form_offer of_form = new Forms.Form_offer();
     of_form.setData(-1, sCon);
     of_form.ShowDialog();
     if (of_form.DialogResult == DialogResult.OK) sCon.refresh(current_sDA, dS_main, dGV_main);
 }
Пример #2
0
        private void dGV_main_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0 && e.RowIndex < dGV_main.RowCount - 1)
            {
                switch (dS_main.Tables[0].TableName)
                {
                    case "ship_routes":
                        Forms.Form_ship_route sr_form = new Forms.Form_ship_route();
                        sr_form.setData((int)dS_main.Tables[dS_main.Tables[0].TableName].Rows[e.RowIndex]["RouteID"], sCon);
                        sr_form.ShowDialog();
                        if (sr_form.DialogResult == DialogResult.OK) sCon.refresh(current_sDA, dS_main, dGV_main);
                        break;

                    case "ship_tours":
                        Forms.Form_ship_tour st_form = new Forms.Form_ship_tour();
                        st_form.setData((int)dS_main.Tables[dS_main.Tables[0].TableName].Rows[e.RowIndex]["TourID"], sCon);
                        st_form.ShowDialog();
                        if (st_form.DialogResult == DialogResult.OK) sCon.refresh(current_sDA, dS_main, dGV_main);
                        break;

                    case "offers":
                        Forms.Form_offer of_form = new Forms.Form_offer();
                        of_form.setData((int)dS_main.Tables[dS_main.Tables[0].TableName].Rows[e.RowIndex]["OfferID"], sCon);
                        of_form.ShowDialog();
                        if (of_form.DialogResult == DialogResult.OK) sCon.refresh(current_sDA, dS_main, dGV_main);
                        break;

                    case "transactions":
                        Forms.Form_Transaction tf_form = new Forms.Form_Transaction();
                        tf_form.setData((int)dS_main.Tables[dS_main.Tables[0].TableName].Rows[e.RowIndex]["TransID"], sCon);
                        tf_form.ShowDialog();
                        if (tf_form.DialogResult == DialogResult.OK) sCon.refresh(current_sDA, dS_main, dGV_main);
                        break;

                    case "passengers":
                        Forms.Form_Passenger ps_form = new Forms.Form_Passenger();
                        ps_form.setData((int)dS_main.Tables[dS_main.Tables[0].TableName].Rows[e.RowIndex]["PassengerID"], -1, sCon);
                        ps_form.ShowDialog();
                        if (ps_form.DialogResult == DialogResult.OK) sCon.refresh(current_sDA, dS_main, dGV_main);
                        break;

                }
            }
        }