Example #1
0
 public ContoViewLight()
 {
     InitializeComponent();
     vm = new ContoViewModelLight();
     vm.SetFocusExecuted         += OnVmOnSetFocusExecuted;
     vm.SinkInfo                 += OnSinkInfo;
     DataContext                  = vm;
     datePicker1.DisplayDateStart = vm.MinDate;
     datePicker1.DisplayDateEnd   = vm.MaxDate;
     datePicker2.DisplayDateEnd   = vm.MaxDate;
 }
Example #2
0
        public FacturaControlViewModel(AccountsModel accountsModel, ContoViewModelLight contoView, bool WithContragentSum, string antetka, string contr = null, bool onlyContragent = false, bool withpisma = false)
        {
            _movements             = new List <AccItemSaldo>();
            OnlyContragent         = onlyContragent;
            cv1                    = 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 = 30
            });
            _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
            });

            ReportItems = _reportItems;
            filter      = null;
            if (contr != null)
            {
                filter = string.Format("|{0} ", contr);
            }
            typerep = 1;

            this.withpisma = withpisma;
        }
Example #3
0
        public FacturaControlViewModel(AccountsModel accountsModel, ContoViewModelLight contoView, bool withContragentSum, bool onlyContragent = false, bool withpisma = false)
        {
            _movements         = new List <AccItemSaldo>();
            this.accountsModel = accountsModel;
            cv1 = 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;
        }
Example #4
0
 public DetailsUniverse(AccountsModel dAccountsModel, string filter, ContoViewModelLight cvm, int tip, EditMode mode, DateTime enddate)
 {
     vm = new DetailsUniverseViewModel(dAccountsModel, filter, cvm, tip, mode, enddate);
     InitializeComponent();
     DataContext = vm;
 }
Example #5
0
 public FacturaControl(AccountsModel accountsModel, ContoViewModelLight cv, string contr = null)
 {
     vm          = new FacturaControlViewModel(accountsModel, cv, true, contr);
     DataContext = vm;
     InitializeComponent();
 }
Example #6
0
        public DetailsUniverseViewModel(AccountsModel dAccountsModel, string filter, ContoViewModelLight cvm, int tip, EditMode mode, DateTime enddate)
        {
            var reportItems = new List <ReportItem>();

            Filt    = filter;
            Filters = new ObservableCollection <Filter>();
            EndDate = enddate;
            Acc     = dAccountsModel;
            if (mode == EditMode.Edit)
            {
                IsEditMode = System.Windows.Visibility.Hidden;
            }
            else
            {
                IsEditMode = System.Windows.Visibility.Visible;
            }
            Title = "Детайли за " + dAccountsModel.ShortName;
            Tip   = tip;
            Cvm1  = 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");
        }