예제 #1
0
        public static EventMD Translate(this EventDE from)
        {
            var to = new EventMD();

            to.Id          = from.Id;
            to.Description = from.Description;
            to.CustomerId  = from.CustomerId.Value;
            to.CompanyId   = from.CompanyId;
            to.CreatedDate = from.CreatedDate;
            to.CreatedById = from.CreatedById;
            to.EventStatus = from.EventStatus;
            to.IsValid     = from.IsValid;

            return(to);
        }
예제 #2
0
        public static EventDE Translate(this EventMD from, EventDE dest = null)
        {
            var to = dest ?? new EventDE();

            if (to.Id <= 0)
            {
                to.Id       = from.Id;
                to.IsActive = true;
            }
            else
            {
                to.IsActive = from.IsActive;
            }
            to.Description = from.Description;
            to.CustomerId  = from.CustomerId;
            to.CompanyId   = from.CompanyId;
            to.CreatedDate = from.CreatedDate;
            to.CreatedById = from.CreatedById;
            to.EventStatus = from.EventStatus;
            to.IsValid     = from.IsValid;


            return(to);
        }