public FacturaComplexViewModelDetail(AccountsModel accountsModel, ContoViewModel contoView, bool WithContragentSum, string antetka, string contr = null, bool onlyContragent = false, string kindval = null) { _movements = new List <AccItemSaldo>(); OnlyContragent = onlyContragent; cv = contoView; this.accountsModel = accountsModel; this.antetka = antetka; this.WithContragentSum = WithContragentSum; var _reportItems = new List <ReportItem>(); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Код", Width = 10 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Контрагент", Width = 50 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Номер Фактура", Width = 10 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Дата", Width = 10 }); // _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "НС Дебит ", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "НС", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Оборот Дебит ", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Оборот Кредит", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "КС", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Папка", Width = 15, IsSuma = false }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Номер Документ", Width = 15, IsSuma = false }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Основание", Width = 30, IsSuma = false }); _reportItems.Add(new ReportItem { Height = 30, IsShow = true, Name = "Признак 1", Width = 10 }); _reportItems.Add(new ReportItem { Height = 30, IsShow = true, Name = "Признак 2", Width = 10 }); ReportItems = _reportItems; filter = null; if (contr != null) { filter = string.Format("|{0} ", contr); } typerep = 1; }
public ContoView() { InitializeComponent(); vm = new ContoViewModel(); vm.SetFocusExecuted += OnVmOnSetFocusExecuted; vm.SinkInfo += OnSinkInfo; DataContext = vm; datePicker1.DisplayDateStart = vm.MinDate; datePicker1.DisplayDateEnd = vm.MaxDate; datePicker2.DisplayDateEnd = vm.MaxDate; }
public FacturaComplexViewModelDetail(AccountsModel accountsModel, ContoViewModel contoView, bool withContragentSum, bool onlyContragent = false) { _movements = new List <AccItemSaldo>(); this.accountsModel = accountsModel; cv = contoView; this.WithContragentSum = withContragentSum; this.OnlyContragent = onlyContragent; var _reportItems = new List <ReportItem>(); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Код", Width = 10 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Контрагент", Width = 50 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Номер Фактура", Width = 10 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Дата", Width = 10 }); // _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "НС Дебит ", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "НС", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Оборот Дебит ", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Оборот Кредит", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "КС", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Папка", Width = 15, IsSuma = false }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Номер Документ", Width = 15, IsSuma = false }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Основание", Width = 30, IsSuma = false }); _reportItems.Add(new ReportItem { Height = 30, IsShow = true, Name = "Признак 1", Width = 10 }); _reportItems.Add(new ReportItem { Height = 30, IsShow = true, Name = "Признак 2", Width = 10 }); ReportItems = _reportItems; }
public FacturaControlViewModel(AccountsModel accountsModel, ContoViewModel contoView, bool withContragentSum, bool onlyContragent = false, bool withpisma = false) { _movements = new List <AccItemSaldo>(); this.accountsModel = accountsModel; cv = contoView; this.WithContragentSum = withContragentSum; this.OnlyContragent = onlyContragent; var _reportItems = new List <ReportItem>(); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Код", Width = 10 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Контрагент", Width = 50 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Номер Фактура", Width = 10 }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Дата", Width = 10 }); // _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "НС Дебит ", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "НС", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Оборот Дебит ", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "Оборот Кредит", Width = 15, IsSuma = true }); _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "КС", Width = 15, IsSuma = true }); // _reportItems.Add(new ReportItem { Height = 10, IsShow = true, Name = "КС Кредит", Width = 15, IsSuma = true }); this.withpisma = withpisma; ReportItems = _reportItems; }
public DetailsUniverse(AccountsModel dAccountsModel, string filter, ContoViewModel cvm, int tip, EditMode mode, DateTime enddate) { vm = new DetailsUniverseViewModel(dAccountsModel, filter, cvm, tip, mode, enddate); InitializeComponent(); DataContext = vm; }
public FacturaControl(AccountsModel accountsModel, ContoViewModel cv, string contr = null) { vm = new FacturaControlViewModel(accountsModel, cv, true, contr); DataContext = vm; InitializeComponent(); }
public DetailsUniverseViewModel(AccountsModel dAccountsModel, string filter, ContoViewModel cvm, int tip, EditMode mode, DateTime enddate) { var reportItems = new List <ReportItem>(); Filt = filter; EndDate = enddate; Filters = new ObservableCollection <Filter>(); Acc = dAccountsModel; if (mode == EditMode.Edit) { IsEditMode = System.Windows.Visibility.Hidden; } else { IsEditMode = System.Windows.Visibility.Visible; } Title = "Детайли за " + dAccountsModel.ShortName; Tip = tip; Cvm = cvm; List <List <string> > v = null; var c = Context.GetDetailsContoToAccUni(dAccountsModel.Id, dAccountsModel.TypeAccount, dAccountsModel.Kol, dAccountsModel.Val, filter, EndDate); if (c != null) { v = c.Select(i => i.ToList()).ToList(); } _fields = new List <List <string> >(); if (v != null) { foreach (var item in v) { _fields.Add(new List <string>(item)); } foreach (var item in _fields[0]) { Filters.Add(new ViewModels.ContragenManager.Filter { FilterName = item }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, Name = item, Width = 15 }); } } else { var r = new List <string>(); var atr = Context.LoadAllAnaliticfields(dAccountsModel.Id); foreach (SaldoAnaliticModel saldoAnaliticModel in atr) { r.Add(saldoAnaliticModel.Name); reportItems.Add(new ReportItem { Height = 30, IsShow = true, Name = saldoAnaliticModel.Name, Width = 15 }); } r.Add("НС"); r.Add("ОД"); r.Add("ОК"); r.Add("КС"); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "НС", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "ОД", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "ОК", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "КС", Width = 10 }); if (dAccountsModel.Val == 1) { r.Add("НСВ"); r.Add("ОДВ"); r.Add("ОКВ"); r.Add("КСВ"); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "НСВ", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "ОДВ", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "ОКВ", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "КСВ", Width = 10 }); } if (dAccountsModel.Kol == 1) { r.Add("НСК"); r.Add("ОДК"); r.Add("ОКК"); r.Add("КСК"); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "НСК", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "ОДК", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "ОКК", Width = 10 }); reportItems.Add(new ReportItem { Height = 30, IsShow = true, IsSuma = true, Sborno = true, Name = "КСК", Width = 10 }); } _fields.Add(r); } if (dAccountsModel.Kol == 1) { Fields = new List <List <string> >(_fields.Where(e => e[e.Count - 5] != Vf.KolFormatUI)); } else if (dAccountsModel.Val == 1) { Fields = new List <List <string> >(_fields.Where(e => e[e.Count - 5] != Vf.ValFormatUI)); } else { Fields = new List <List <string> >(_fields.Where(e => e[e.Count - 1] != Vf.LevFormatUI)); } ReportItems = reportItems; OnPropertyChanged("Fields"); }
public void SetUp() { _testClass = new ContoViewModel(); _testClass.Context = new FakeDataContect(); }