Ejemplo n.º 1
0
        public void ImportFlowChartWUXI_M(FlowChartImport importItem, int accountID)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    FlowChart_Master flMasterItem = new FlowChart_Master();
                    flMasterItem = AutoMapper.Mapper.Map <FlowChart_Master>(importItem.FlowChartMasterDTO);
                    flowChartMasterRepository.Add(flMasterItem);

                    foreach (var detailDTOItem in importItem.FlowChartImportDetailDTOList)
                    {
                        var detailItem = AutoMapper.Mapper.Map <FlowChart_Detail>(detailDTOItem.FlowChartDetailDTO);
                        flMasterItem.FlowChart_Detail.Add(detailItem);

                        //var mgDataItem = AutoMapper.Mapper.Map<FlowChart_MgData>(detailDTOItem.FlowChartMgDataDTO);
                        //detailItem.FlowChart_MgData.Add(mgDataItem);
                    }
                    unitOfWork.Commit();
                    //将数据插入到中间表
                    flowChartMasterRepository.ExecSPTemp(importItem);
                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        private FlowChartGet SetAutoMapFlChart(FlowChart_Master item)
        {
            FlowChartGet model = new FlowChartGet();

            model.FlowChartMasterDTO = AutoMapper.Mapper.Map <FlowChartMasterDTO>(item);
            model.SystemProjectDTO   = AutoMapper.Mapper.Map <SystemProjectDTO>(item.System_Project);
            model.SystemUserDTO      = AutoMapper.Mapper.Map <SystemUserDTO>(item.System_Users);
            model.BU_D_Name          = item.System_Project.System_BU_D.BU_D_Name;
            return(model);
        }