示例#1
0
        private void View_AddDataBaseContent(object sender, EventArgs e)
        {
            IDBHistory history = (IDBHistory)sender;

            _manager.SetDBHistories(history);
            _view.DgDbHistiry(_manager.GetDBHistories());
            _addContent.DataGridDBHistory.ItemsSource = _manager.GetDBHistories();
        }
示例#2
0
        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();
            }
        }
示例#3
0
        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;
        }