コード例 #1
0
        private static void serialiseConto(TempoDataBaseContext context)
        {
            var      Allconto = context.GetAllConto(1, 2000, 20);
            ContoAll contoAll = new ContoAll();

            contoAll.Conto      = Allconto.First();
            contoAll.ItemsDebit =
                new List <SaldoItem>(DbHelper.LoadCreditAnaliticAtributes(context.LoadContoDetails(contoAll.Conto.Id, 1), 1));

            contoAll.ItemsCredit =
                new List <SaldoItem>(DbHelper.LoadCreditAnaliticAtributes(context.LoadContoDetails(contoAll.Conto.Id, 2), 2));
            SerializeUtil.SerializeToXML <ContoAll>("test.xml", contoAll);
        }
コード例 #2
0
        private IEnumerable <SaldoItem> LoadDetails(int contoid, int typeconto, TempoDataBaseContext context)
        {
            if (contoid == 0)
            {
                return(new List <SaldoItem>());
            }
            var items = ContoRepository.Instance.ContoItems(string.Format("{0}-{1}", contoid, typeconto));

            if (items != null)
            {
                return(items);
            }
            var itemsforcache = LoadCreditAnaliticAtributes(context.LoadContoDetails(contoid, typeconto), typeconto,
                                                            context);

            ContoRepository.Instance.Add(string.Format("{0}-{1}", contoid, typeconto), itemsforcache.ToList());
            return(itemsforcache);
        }