protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
            Application.Current.ShutdownMode = ShutdownMode.OnLastWindowClose;
            //this.DataContext = new JournalViewModel();
            JournalViewModel vm = new JournalViewModel();

            this.DataContext = vm;
        }
示例#2
0
 public static string GetInfoPerDate(DateTime date)
 {
     string result = string.Empty;
     JournalViewModel viewModel = new JournalViewModel();
     viewModel.CurrentDate = date.Date;
     List<Journal> list = viewModel.JournalList;
     list.ForEach(item => {
         result += string.Format("<tr><td>{0}({1})</td> <td>{2}</td> <td>{3}</td> <td>{4}</td> <td>{5}</td><td>{6}</td></tr>",
             item.Tovar.Kod,item.Tovar.ID_Tovar, item.Tovar.NameTovar, item.Amount, item.Tovar.CinaProdazh, item.Price,item.User.Login);
     });
     result += string.Format("<tr><td colspan=6 align=right>Всього: {0}</tr>",list.Sum(j=>j.Amount*j.Price));
     return result;
 }