public void SaveMapping(OutgestionJsonModel mapJson)
        {
            ZionWeb.DAL.Entities.TempOutboundMaster tempMapping = new TempOutboundMaster
            {
                DatasetId        = mapJson.DataSetId,
                Status           = true,
                TemplateId       = mapJson.TemplateId,
                IsWithoutTempate = mapJson.IsWithoutTempate,
                IsErrorOutbound  = mapJson.IsErrorOutbound,
                CreatedBy        = mapJson.CreatedBy,
                CreatedDate      = DateTime.Now,
                UpdatedBy        = mapJson.UpdatedBy,
            };
            List <ZionWeb.DAL.Entities.TempCoreToOutboundDetails> tempMapDetails = new List <ZionWeb.DAL.Entities.TempCoreToOutboundDetails>();
            int order = 1;

            mapJson.MappingArray.ForEach(m =>
            {
                if (m.Source.CoreDetailId != 0)
                {
                    TempCoreToOutboundDetails mapRow = new TempCoreToOutboundDetails
                    {
                        CreatedBy        = mapJson.CreatedBy,
                        CreatedDate      = DateTime.Now,
                        CoreDetailId     = m.Source.CoreDetailId,
                        TemplateDetailId = (int)m.Target.TemplateDetailId,
                        Order            = order
                    };
                    tempMapDetails.Add(mapRow);
                    order++;
                }
            }
                                         );
            _outgestionDAL.SaveMapping(tempMapping, tempMapDetails);
        }
        private OutgestionJsonModel PopulateJsonRecord(List <OutgestionMapRecordModel> records)
        {
            OutgestionJsonModel outgestion = new OutgestionJsonModel
            {
                DataSetId        = (int)records[0].DataSetId,
                InterfaceId      = records[0].InterfaceId,
                TemplateName     = records[0].TemplateName,
                IsWithoutTempate = records[0].IsWithoutTempate,
                IsErrorOutbound  = records[0].IsErrorOutbound,
                TemplateId       = records[0].TemplateId,
                CreatedBy        = records[0].CreatedBy,
                UpdatedBy        = records[0].UpdatedBy
            };

            outgestion.MappingArray = (from map in records
                                       select new OutgestionMapItemModel
            {
                Source = new CoreTableDetailsModel
                {
                    CoreDetailId = map.CoreDetailId,
                    TableName = map.CoreTableName,
                    ColumnName = map.CoreColumnName,
                    IsTransformed = map.IsTransformed
                },
                Target = new TemplateDetailModel
                {
                    TemplateDetailId = map.TemplateDetailId,
                    columnName = map.TemplateColumnName,
                    RequiredFlag = map.TemplateColumnRequiredFlag,
                    IsTransformed = map.IsTransformed
                }
            }
                                       ).ToList();

            return(outgestion);
        }
 public string SaveMapping([FromBody] OutgestionJsonModel mapJson) //CoreToPartyMappingModel
 {
     _outgestionManager.SaveMapping(mapJson);
     return("success");
 }