Пример #1
0
        /// <summary>
        /// Converts this instance of <see cref="tblAccountsMaster"/> to an instance of <see cref="tblAccountsMasterDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="tblAccountsMaster"/> to convert.</param>
        public static tblAccountsMasterDTO ToDTO(this tblAccountsMaster entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new tblAccountsMasterDTO();

            dto.AccountId   = entity.AccountId;
            dto.AccountName = entity.AccountName;
            dto.AccountType = entity.AccountType;
            if (Convert.ToInt32(dto.AccountType) == (int)AccountType.Bank)
            {
                dto.AccountTypeName = AccountType.Bank.ToString();
            }
            else
            {
                dto.AccountTypeName = AccountType.Cash.ToString();
            }
            dto.AccountNo      = entity.AccountNo;
            dto.Addrees        = entity.Addrees;
            dto.PhoneNo        = entity.PhoneNo;
            dto.OpeningBalance = entity.OpeningBalance;
            dto.OpeningDate    = entity.OpeningDate;
            dto.Description    = entity.Description;

            entity.OnDTO(dto);

            return(dto);
        }
Пример #2
0
        /// <summary>
        /// Converts this instance of <see cref="tblAccountsMasterDTO"/> to an instance of <see cref="tblAccountsMaster"/>.
        /// </summary>
        /// <param name="dto"><see cref="tblAccountsMasterDTO"/> to convert.</param>
        public static tblAccountsMaster ToEntity(this tblAccountsMasterDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new tblAccountsMaster();

            entity.AccountId      = dto.AccountId;
            entity.AccountName    = dto.AccountName;
            entity.AccountType    = dto.AccountType;
            entity.AccountNo      = dto.AccountNo;
            entity.Addrees        = dto.Addrees;
            entity.PhoneNo        = dto.PhoneNo;
            entity.OpeningBalance = dto.OpeningBalance;
            entity.OpeningDate    = dto.OpeningDate;
            entity.Description    = dto.Description;

            dto.OnEntity(entity);

            return(entity);
        }
Пример #3
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="tblAccountsMaster"/> converted from <see cref="tblAccountsMasterDTO"/>.</param>
 static partial void OnEntity(this tblAccountsMasterDTO dto, tblAccountsMaster entity);
Пример #4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="tblAccountsMasterDTO"/> converted from <see cref="tblAccountsMaster"/>.</param>
 static partial void OnDTO(this tblAccountsMaster entity, tblAccountsMasterDTO dto);