/// <summary> ///Funcion que convierte un CustomerServiceDataEntity en un TemplateListFormDocumentWpf para ser usado en un proyecto wpf /// </summary> /// <param name="customerServiceDataEntity"></param> /// <returns></returns> public static TemplateListFormDocumentWpf ConvertEntityToTemplateListDocument(CustomerServiceDataEntity customerServiceDataEntity) { TemplateListFormDocumentWpf templateListFormDocument = new TemplateListFormDocumentWpf(); foreach (ComponentEntity templateListItemEntity in customerServiceDataEntity.Components) { TemplateListItemWpf templateListItemWpf = ConvertEntityToTemplateListItemWpf(templateListItemEntity); templateListFormDocument.Components.Add(templateListItemWpf); } return(templateListFormDocument); }
/// <summary> /// Convierte un ComponentEntity guardado en la base de datos que representa un TemplateListItem en un TemplateListItemWpf para ser usado en un proyecto wpf /// </summary> /// <param name="templateListItemEntity"></param> /// <returns></returns> public static TemplateListItemWpf ConvertEntityToTemplateListItemWpf(ComponentEntity templateListItemEntity) { Field tempField = ConvertEntityToField(templateListItemEntity.FieldAssociated); TemplateListItemWpf templateListItem = new TemplateListItemWpf(tempField, (FontName)templateListItemEntity.FontName, (FontSize)templateListItemEntity.FontSize, (DataType)templateListItemEntity.DataTypes); templateListItem.MakeCanvas(); templateListItem.BackgroundColor = templateListItemEntity.BackgroundColor; templateListItem.Bold = templateListItemEntity.Bold; templateListItem.DataType = (DataType)templateListItemEntity.DataTypes; templateListItem.FontColor = templateListItemEntity.FontColor; templateListItem.FontName = (FontName)templateListItemEntity.FontName; templateListItem.FontSize = (FontSize)templateListItemEntity.FontSize; templateListItem.Height = templateListItemEntity.Height; templateListItem.Width = templateListItemEntity.Width; templateListItem.Italic = templateListItemEntity.Italic; templateListItem.Underline = templateListItemEntity.Underline; templateListItem.XCoordinateRelativeToParent = templateListItemEntity.XCoordinateRelativeToParent; templateListItem.YCoordinateRelativeToParent = templateListItemEntity.YCoordinateRelativeToParent; templateListItem.XFactorCoordinateRelativeToParent = templateListItemEntity.XFactorCoordinateRelativeToParent; templateListItem.YFactorCoordinateRelativeToParent = templateListItemEntity.YFactorCoordinateRelativeToParent; templateListItem.HeightFactor = templateListItemEntity.HeightFactor; templateListItem.WidthFactor = templateListItemEntity.WidthFactor; return(templateListItem); }