Beispiel #1
0
        public static tbl_MarkerDetail MapToMarkerDetail(MarkerListViewModel markerObject)
        {
            var markerMeterPersizes = new ObservableCollection <tbl_MarkerDetailMeterPerSize>();

            foreach (var meterPerSize in markerObject.MeterPerSizeList)
            {
                markerMeterPersizes.Add(MapToMeterPerSize(meterPerSize));
            }

            return(new tbl_MarkerDetail
            {
                Iserial = markerObject.Iserial,
                BatchNo = markerObject.BatchNo,
                StyleColorCode = markerObject.StyleColorCode,
                FabricCode = markerObject.FabricCode,
                FabricColorCode = markerObject.FabricColorCode,
                MarkerL = markerObject.MarkerL,
                MarkerNo = markerObject.MarkerNo,
                MarkerW = markerObject.MarkerW,
                SizeRange = markerObject.SizeRange,
                StyleNo = markerObject.StyleNo,
                SalesOrder = markerObject.SalesOrder,
                MarkerTransactionHeader = markerObject.MarkerTransactionHeader,
                CloretteCmPerPc = markerObject.CloretteCmPerPc,

                tbl_MarkerDetailMeterPerSize = markerMeterPersizes,

                TotalReq = markerObject.TotalReq,
                Status = markerObject.Status
            });
        }
 void LinkActions(ref MarkerListViewModel markerList)
 {
     markerList.Actions = new MarkerListActions()
     {
         Delete = OnListDelete,
         Export = OnListExport
     };
 }
Beispiel #3
0
        public static MarkerListViewModel MapToMarkerDetail(tbl_MarkerDetail markerObject)
        {
            var markerMeterPersizes = new ObservableCollection <MeterPerSize>();

            foreach (var meterPerSize in markerObject.tbl_MarkerDetailMeterPerSize)
            {
                markerMeterPersizes.Add(MapToMeterPerSize(meterPerSize));
            }
            var styleColorlist = new ObservableCollection <MarkerSalesOrderDetail>
            {
                new MarkerSalesOrderDetail
                {
                    StyleColorCode    = markerObject.TblColor.Code,
                    StyleColorIserial = markerObject.TblColor.Iserial
                }
            };

            var fabricColorList = new ObservableCollection <MarkerSalesOrderDetail>
            {
                new MarkerSalesOrderDetail
                {
                    FabricColorCode    = markerObject.TblColor1.Code,
                    FabricColorIserial = markerObject.TblColor1.Iserial
                }
            };
            var listOfCutting = new ObservableCollection <CuttingOrderViewModel>();

            foreach (var variable in markerObject.Tbl_Wf_CuttingOrder)
            {
                var newrow = new CuttingOrderViewModel().InjectFrom(variable) as CuttingOrderViewModel;
                listOfCutting.Add(newrow);
            }
            double totalreq = 0;

            if (markerObject.TotalReq != null)
            {
                totalreq = (double)markerObject.TotalReq;
            }
            if (markerObject.Status == null)
            {
                markerObject.Status = 0;
            }
            var row = new MarkerListViewModel
            {
                Iserial                 = markerObject.Iserial,
                BatchNo                 = markerObject.BatchNo,
                StyleColorCode          = markerObject.StyleColorCode,
                FabricCode              = markerObject.FabricCode,
                FabricColorCode         = markerObject.FabricColorCode,
                FabricColorList         = fabricColorList,
                StyleDetailsList        = styleColorlist,
                MarkerL                 = markerObject.MarkerL,
                MarkerNo                = markerObject.MarkerNo,
                MarkerW                 = markerObject.MarkerW,
                SizeRange               = markerObject.SizeRange,
                StyleNo                 = markerObject.StyleNo,
                SalesOrder              = markerObject.SalesOrder,
                MarkerTransactionHeader = markerObject.MarkerTransactionHeader,
                CloretteCmPerPc         = markerObject.CloretteCmPerPc,
                Status = (int)markerObject.Status,
                SavedCuttingOrderlist = listOfCutting,
                TotalReq = totalreq
            };

            GenericMapper.InjectFromObCollection(row.MeterPerSizeList, markerMeterPersizes);

            return(row);
        }
 void UnlinkActions(ref MarkerListViewModel markerList)
 {
 }