private void View_AddDataBaseContent(object sender, EventArgs e) { IDBHistory history = (IDBHistory)sender; _manager.SetDBHistories(history); _view.DgDbHistiry(_manager.GetDBHistories()); _addContent.DataGridDBHistory.ItemsSource = _manager.GetDBHistories(); }
public void SetDBHistories(IDBHistory history) { using (IDbConnection con = new SqlConnection(Settings.Default.DBMoneyManage)) { IDbCommand command = new SqlCommand($"INSERT INTO MyDBMoneyManager(Username, SumMoney) VALUES('{history.UserName}', '{history.Money}');"); command.Connection = con; con.Open(); IDataReader reader = command.ExecuteReader(); } }
public MainPresenter(IMainWindow view, IDBManager manager, IDBHistory history, AddContent addContent) { _view = view; _manager = manager; _history = history; _addContent = addContent; _view.GetWeather += GetWeather; _view.CurrentMoney += CurrentMoney; _addContent.WievDataGridDBHistory += WiewContent; _addContent.SetDataBaseContent += View_AddDataBaseContent; }