Exemplo n.º 1
0
 private void Refresh()
 {
     Valuts = new ObservableCollection <ValutaEntityWraper>();
     foreach (var item in Context.GetCurRates(_code, _fromdata, _todata))
     {
         var litem = new ValutaEntityWraper(item);
         litem.Codes = new ObservableCollection <string>(Codes);
         Valuts.Add(litem);
     }
 }
Exemplo n.º 2
0
        private void dgEmp_BeginningEdit(object sender, DataGridBeginningEditEventArgs e)
        {
            isBeingEdited = true;
            ValutaEntityWraper emp = e.Row.DataContext as ValutaEntityWraper;

            if (emp != null)
            {
                emp.State = 1;
            }
        }
Exemplo n.º 3
0
        private void dgEmp_RowEditEnding(object sender, DataGridRowEditEndingEventArgs e)
        {
            ValutaEntityWraper emp = e.Row.DataContext as ValutaEntityWraper;

            if (e.EditAction == DataGridEditAction.Cancel)
            {
                e.Cancel = false;
                return;
            }

            if (e.EditAction == DataGridEditAction.Commit)
            {
                vm.SaveKursFromOutSide(emp);
            }
        }
Exemplo n.º 4
0
 internal void SaveKursFromOutSide(ValutaEntityWraper emp)
 {
     Context.SaveKurs(emp.Date, emp.CodeVal, emp.Value);
     if (Valuts != null)
     {
         foreach (var valutaEntityWraper in Valuts)
         {
             if (valutaEntityWraper.State == 1)
             {
                 Context.SaveKurs(valutaEntityWraper.Date, valutaEntityWraper.CodeVal, valutaEntityWraper.Value);
             }
         }
     }
     Refresh();
     OnPropertyChanged("Valuts");
 }