Exemplo n.º 1
0
        public static SalesOrderModel ConverToModel(SalesOrderHeader so)
        {
            PrimitiveCloner cloner = new PrimitiveCloner(typeof(SalesOrderHeader), typeof(SalesOrderModel));
            SalesOrderModel model  = new SalesOrderModel();

            cloner.Clone(so, model);
            return(model);
        }
Exemplo n.º 2
0
        public static List <SalesOrderDetailModel> ConverToModel(ICollection <SalesOrderDetail> salesOrderDetails)
        {
            List <SalesOrderDetailModel> detailsModel = new List <SalesOrderDetailModel>();
            PrimitiveCloner cloner = new PrimitiveCloner(typeof(SalesOrderDetail), typeof(SalesOrderDetailModel));

            foreach (var detail in salesOrderDetails)
            {
                SalesOrderDetailModel model = new SalesOrderDetailModel();
                cloner.Clone(detail, model);
                detailsModel.Add(model);
            }
            return(detailsModel);
        }
Exemplo n.º 3
0
        public static void ApplyFromModel(SalesOrderHeader so, SalesOrderModel model)
        {
            PrimitiveCloner cloner = new PrimitiveCloner(typeof(SalesOrderModel), typeof(SalesOrderHeader));

            cloner.Clone(model, so);
        }