Exemplo n.º 1
0
 public void CopyTo(Entities.AccountTree entity)
 {
     entity.Active      = Active;
     entity.Code        = Code;
     entity.DeletedMark = DeletedMark;
     entity.Description = Description;
     entity.Name        = Name;
     entity.Version     = Version;
 }
Exemplo n.º 2
0
 public void CopyFrom(Entities.AccountTree entity)
 {
     Active      = entity.Active;
     Code        = entity.Code;
     DeletedMark = entity.DeletedMark;
     Description = entity.Description;
     Name        = entity.Name;
     Version     = entity.Version;
 }
        protected override GetCompleteAccountTreeResponse RunInContext(GetCompleteAccountTreeRequest request, PersistenceContext context)
        {
            var response = new GetCompleteAccountTreeResponse();

            Entities.AccountTree tree = context.Session
                                        .CreateCriteria(typeof(Entities.AccountTree), "tree")
                                        .Add(Expression.IdEq(request.AccountTreeId))
                                        .SetFetchMode("Accounts", FetchMode.Eager)
                                        .UniqueResult <Entities.AccountTree>();

            response.AccountTreeHeader =
                new UI.AccountTreeListItem(tree);

            /*-*
             * new UI.AccountTreeListItem(tree.Id)
             * {
             *  Active = tree.Active,
             *  Code = tree.Code,
             *  Description = tree.Description,
             *  Name = tree.Name,
             *  Version = tree.Version
             * };
             */
            response.Items = new List <Facturanet.UI.ContableAccount>();

            foreach (var entity in tree.Accounts)
            {
                response.Items.Add(new UI.ContableAccount(entity)

                                   /*-*
                                    * new UI.ContableAccount(entity.Id)
                                    * {
                                    *  Active = entity.Active,
                                    *  Code = entity.Code,
                                    *  Description = entity.Description,
                                    *  Imputable = entity.Imputable,
                                    *  Name = entity.Name,
                                    *  ParentAccountId = entity.ParentAccount == null
                                    *      ? null
                                    *      : (Guid?)entity.ParentAccount.Id,
                                    *  Version = entity.Version
                                    * }*/
                                   );
            }

            return(response);
        }
Exemplo n.º 4
0
 public AccountTreeListItem(Entities.AccountTree entity)
     : this(entity.Id)
 {
     CopyFrom(entity);
 }
Exemplo n.º 5
0
 public CreateAccountTreeRequest(Entities.AccountTree accountTree)
 {
     AccountTree = accountTree;
 }