Exemplo n.º 1
0
        private static string ExecuteDialog(TheAltisProjectDatabase.IDatabaseCargoGui iDatabase, string table, Int64 id, string cargoId, string cargoType, string cargoData, bool insert)
        {
            using (EditDialog dlg = new EditDialog())
            {
                dlg.txtCargoId.Text   = cargoId;
                dlg.cmbCargoType.Text = cargoType;
                dlg.txtCargoData.Text = cargoData;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if (insert)
                    {
                        iDatabase.Insert(table, dlg.txtCargoId.Text, dlg.cmbCargoType.Text, dlg.txtCargoData.Text);
                    }
                    else
                    {
                        iDatabase.Update(table, id, dlg.txtCargoId.Text, dlg.cmbCargoType.Text, dlg.txtCargoData.Text);
                    }

                    return(dlg.txtCargoId.Text);
                }

                return("");
            }
        }
Exemplo n.º 2
0
        public FormMain()
        {
            InitializeComponent();

            _IDatabase = new TheAltisProjectDatabase.DatabaseCargoSQLite(new LogManager(), "..\\DatabaseCargo.sqlite");

            cmbCargoType.SelectedIndex = 0;
            RefreshComboboxTable();
            cmbTable.SelectedIndex = cmbTable.Items.Count - 1;
        }
Exemplo n.º 3
0
 public static string ExecuteDialog_Update(TheAltisProjectDatabase.IDatabaseCargoGui iDatabase, string table, Int64 id, string cargoId, string cargoType, string cargoData)
 {
     return(ExecuteDialog(iDatabase, table, id, cargoId, cargoType, cargoData, false));
 }
Exemplo n.º 4
0
 public static string ExecuteDialog_Insert(TheAltisProjectDatabase.IDatabaseCargoGui iDatabase, string table, string cargoId, string cargoType)
 {
     return(ExecuteDialog(iDatabase, table, -1, cargoId, cargoType, "", true));
 }