private void ConvertService(DescriptionType wsdl2, ServiceDescription wsdl1) { var services = wsdl2.Items.Where(s => s is ServiceType); foreach (ServiceType s2 in services) { var s1 = new Service(); wsdl1.Services.Add(s1); s1.Name = s2.name; foreach (EndpointType e2 in s2.Items) { var p1 = new Port(); s1.Ports.Add(p1); p1.Name = e2.name; p1.Binding = e2.binding; var sab = new SoapAddressBinding() { Location = e2.address }; var sab12 = new Soap12AddressBinding() { Location = e2.address }; p1.Extensions.Add(sab); p1.Extensions.Add(sab12); } } }
private void setDescriptionType(object sender, RoutedEventArgs e) { if ((Boolean)rb_descNone.IsChecked) { _currentDescType = DescriptionType.None; cbItemDesc.IsEnabled = false; singleFieldGrid.Visibility = System.Windows.Visibility.Collapsed; CustomDescGrid.Visibility = System.Windows.Visibility.Collapsed; rtDesc.IsEnabled = false; } else if ((Boolean)rb_descSinglefld.IsChecked) { _currentDescType = DescriptionType.SingleField; cbItemDesc.IsEnabled = true; singleFieldGrid.Visibility = System.Windows.Visibility.Visible; CustomDescGrid.Visibility = System.Windows.Visibility.Collapsed; rtDesc.IsEnabled = false; } else if ((Boolean)rb_descCustom.IsChecked) { _currentDescType = DescriptionType.Custom; singleFieldGrid.Visibility = System.Windows.Visibility.Collapsed; CustomDescGrid.Visibility = System.Windows.Visibility.Visible; cbItemDesc.IsEnabled = false; rtDesc.IsEnabled = true; } if (listDs.SelectedIndex > -1) { OOBDataSource ods = OOBDataSources[listDs.SelectedItem.ToString()]; if (ods != null) { ods.DescType = _currentDescType; } } }
private void ConvertImports(DescriptionType wsdl2, ServiceDescription wsdl1) { var imports = wsdl2.Items.Where(s => s is ImportType); foreach (ImportType i in imports) { string loc = i.location; InvokeDocumentReference(ref loc); wsdl1.Imports.Add(new Import() { Namespace = i.@namespace, Location = loc }); } var includes = wsdl2.Items.Where(s => s is IncludeType); foreach (IncludeType i in includes) { string loc = i.location; InvokeDocumentReference(ref loc); wsdl1.Imports.Add(new Import() { Location = loc }); } }
static ContactRepository() { DescriptionType relationship = DescriptionType.InaRelationship; DescriptionType free = DescriptionType.Free; DescriptionType complicated = DescriptionType.ItsComplicated; if (Contacts == null) { Contacts = new List <Contact> { new Contact { Id = 1, Name = "xristina", Description = free.GetDisplayName(), ImageUrl = "istockphoto.jpg" }, new Contact { Id = 2, Name = "tina", Description = relationship.GetDisplayName(), ImageUrl = "resources/drawable/istockphoto.jpg" }, new Contact { Id = 3, Name = "ifi", Description = free.GetDisplayName(), ImageUrl = "istockphoto" }, new Contact { Id = 4, Name = "ntina", Description = complicated.GetDisplayName(), ImageUrl = "istockphoto" }, new Contact { Id = 5, Name = "ntina", Description = complicated.GetDisplayName(), ImageUrl = "istockphoto" }, new Contact { Id = 6, Name = "ntina", Description = free.GetDisplayName(), ImageUrl = "istockphoto" } }; } }
private void ConvertBinding(DescriptionType wsdl2, ServiceDescription wsdl1) { var bindings = wsdl2.Items.Where(s => s is BindingType); foreach (BindingType b2 in bindings) { var b1 = new Binding(); wsdl1.Bindings.Add(b1); b1.Name = b2.name; b1.Type = b2.@interface; var v = GetSoapVersion(b2); if (v == SoapVersion.Soap11) { b1.Extensions.Add(new SoapBinding { Transport = "http://schemas.xmlsoap.org/soap/http" }); } else { b1.Extensions.Add(new Soap12Binding { Transport = "http://schemas.xmlsoap.org/soap/http" }); } var operations = b2.Items.Where(s => s is BindingOperationType); foreach (BindingOperationType op2 in operations) { var op1 = new OperationBinding(); b1.Operations.Add(op1); op1.Name = [email protected]; var soap = v == SoapVersion.Soap11 ? new SoapOperationBinding() : new Soap12OperationBinding(); op1.Extensions.Add(soap); soap.SoapAction = FindSoapAction(op2); soap.Style = SoapBindingStyle.Document; var body = v == SoapVersion.Soap11 ? new SoapBodyBinding() : new Soap12BodyBinding(); body.Use = SoapBindingUse.Literal; op1.Input = new InputBinding(); op1.Input.Extensions.Add(body); op1.Output = new OutputBinding(); op1.Output.Extensions.Add(body); HandleHeaders(wsdl1, op2, ItemsChoiceType1.input, op1.Input, v); HandleHeaders(wsdl1, op2, ItemsChoiceType1.output, op1.Output, v); } } }
public IEmployeeDescriptionGenerator Create(DescriptionType descriptionType) { var strategy = _strategies.SingleOrDefault(x => x.DescriptionType == descriptionType); if (strategy == null) { throw new InvalidOperationException($"Not found generator for {descriptionType} description."); } return(strategy); }
public static String GetEnumDesc(DescriptionType e) { FieldInfo enumInfo = e.GetType().GetField(e.ToString()); var enumAttributes = (DescriptionAttribute[])enumInfo. GetCustomAttributes(typeof(DescriptionAttribute), false); if (enumAttributes.Length > 0) { return(enumAttributes[0].Description); } return(e.ToString()); }
//cria uma instancia do problema a partir do tipo e arquivo especificados public TravellingSalesmanMap(string filePath, DescriptionType type) { switch (type) { case DescriptionType.Coordinates: DistanceMatrix = ReadCoordinatesFile(filePath); break; case DescriptionType.Distances: DistanceMatrix = ReadDistancesFile(filePath); break; } CityCount = (int)Math.Sqrt(DistanceMatrix.Length); }
public static string GetDescriptionTypeString(DescriptionType descriptionType) { switch (descriptionType) { case DescriptionType.Brief: return("briefdescription"); case DescriptionType.Detailed: return("detaileddescription"); default: throw new ArgumentException("Unsupported description type."); } }
private void ConvertInterface(DescriptionType wsdl2, ServiceDescription wsdl1) { var interfaces = wsdl2.Items.Where(s => s is InterfaceType); foreach (InterfaceType i2 in interfaces) { var p1 = new PortType(); wsdl1.PortTypes.Add(p1); p1.Name = i2.name; if (i2.Items == null) { continue; } foreach (Object obj in i2.Items) { var op2 = obj as InterfaceOperationType; if (op2 == null) { continue; } var op1 = new Operation(); p1.Operations.Add(op1); op1.Name = op2.name; var msg2In = FindMessage(op2, ItemsChoiceType.input); var msg1In = CreateMessage(wsdl1, op1.Name + "_in", msg2In.element, "parametere"); op1.Messages.Add(new OperationInput() { Message = msg1In }); var msg2Out = FindMessage(op2, ItemsChoiceType.output); bool isOneWay = msg2Out == null; if (!isOneWay) { var msg1Out = CreateMessage(wsdl1, op1.Name + "_out", msg2Out.element, "parameters"); op1.Messages.Add(new OperationOutput() { Message = msg1Out }); } } } }
//cria uma instancia do problema a partir do tipo e arquivo especificados public TravellingSalesmanMap(string filePath, DescriptionType type) { switch (type) { case DescriptionType.Coordinates: DistanceMatrix = ReadCoordinatesFile(filePath); break; case DescriptionType.Distances: DistanceMatrix = ReadDistancesFile(filePath); break; } CityCount = (int)Math.Sqrt(DistanceMatrix.Length); }
private void setDescType(DescriptionType dtype) { if (dtype == DescriptionType.None) { rb_descNone.IsChecked = true; } else if (dtype == DescriptionType.SingleField) { rb_descSinglefld.IsChecked = true; } else if (dtype == DescriptionType.Custom) { rb_descCustom.IsChecked = true; } }
public override string Description(DescriptionType type) { switch (type) { case DescriptionType.Spoken: return($"A new {invasion.Description} rewarding {reward.Description(true, false, true)} has appeared {node.PlanetDescription(true, true)}."); case DescriptionType.Logged: return($"{invasion.Node}: {invasion.Description}. Rewards: {reward.Description(false, true, false)}."); case DescriptionType.Progress: return(TryGetETA(out string eta) ? $"Completion: {Math.Round(Completion)}%. Estimated Remaining: {eta}." : $"Completion: {Math.Round(Completion)}%."); default: return($"{invasion.Node}: {invasion.Description}. Rewards: {reward.Description(false, true, false)}."); } }
public override string Description(DescriptionType type) { switch (type) { case DescriptionType.Spoken: return($"A new Tenno alert rewarding {reward.Description(true, false, true)} has appeared {node.PlanetDescription(true, true)}."); case DescriptionType.Logged: return($"{alert.Mission.Node}: {alert.Mission.Faction} {alert.Mission.Type} Alert. Rewards: {reward.Description(false, true, false)}."); case DescriptionType.Progress: return($"Remaining: {Utilities.ReadableTimeSpan(alert.EndTime.Subtract(DateTime.UtcNow), false)}."); default: return($"{alert.Mission.Node}: {alert.Mission.Faction} {alert.Mission.Type} Alert. Rewards: {reward.Description(false, true, false)}."); } }
private void ConvertTypes(DescriptionType wsdl2, ServiceDescription wsdl1) { var types = wsdl2.Items.FirstOrDefault(s => s is TypesType) as TypesType; if (types == null) { return; } foreach (var e in types.Any) { var sc = new XmlDocument(); var scRoot = sc.ImportNode(e, true); if (scRoot.LocalName.ToLower() == "schema") { var s = XmlSchema.Read(new StringReader(scRoot.OuterXml), null); wsdl1.Types.Schemas.Add(s); } } }
/// <summary> /// Gets descriptions for all fields and/or properties for a <see cref="Type"/>. Add a /// <see cref="DescriptionAttribute(string)"/> to a property or field to give it a description. /// </summary> /// <param name="type">The type of object that has the <see cref="DescriptionAttribute"/> assigned to /// its fields and properties.</param> /// <param name="descriptionType">Used to specify whether you want this method to get descriptions from /// fields, properties, or fields and properties.</param> /// <returns>The descriptions that were retrieved for the <see cref="Type"/>.</returns> public static string[] GetDescriptions(this Type type, DescriptionType descriptionType) { List <string> descriptions = new List <string>(); FieldInfo[] fields = null; PropertyInfo[] properties = null; // Get descriptions for all fields if (descriptionType == DescriptionType.Field || descriptionType == DescriptionType.FieldAndProperty) { fields = type.GetFields(); for (int i = 0; i < fields.Length; i++) { DescriptionAttribute descAttribute = fields[i].GetCustomAttribute <DescriptionAttribute>(); if (descAttribute != null) { descriptions.Add(descAttribute.Description); } } } // Get descriptions for all properties if (descriptionType == DescriptionType.Property || descriptionType == DescriptionType.FieldAndProperty) { properties = type.GetProperties(); for (int i = 0; i < properties.Length; i++) { DescriptionAttribute descAttribute = properties[i].GetCustomAttribute <DescriptionAttribute>(); if (descAttribute != null) { descriptions.Add(descAttribute.Description); } } } return(descriptions.ToArray()); }
protected static string GetTooltip(TooltipDescription tooltipDescription, DescriptionType descriptionType) { if (tooltipDescription == null) { return(string.Empty); } if (descriptionType == DescriptionType.RawDescription) { return(tooltipDescription.RawDescription); } else if (descriptionType == DescriptionType.PlainText) { return(tooltipDescription.PlainText); } else if (descriptionType == DescriptionType.PlainTextWithNewlines) { return(tooltipDescription.PlainTextWithNewlines); } else if (descriptionType == DescriptionType.PlainTextWithScaling) { return(tooltipDescription.PlainTextWithScaling); } else if (descriptionType == DescriptionType.PlainTextWithScalingWithNewlines) { return(tooltipDescription.PlainTextWithScalingWithNewlines); } else if (descriptionType == DescriptionType.ColoredTextWithScaling) { return(tooltipDescription.ColoredTextWithScaling); } else { return(tooltipDescription.ColoredText); } }
public HotelDescriptiveContentTypePromotion() { this._description = new DescriptionType(); }
/// <summary> /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider" /// /> and <see cref="ignoreCase" /> /// </summary> /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param> /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param> /// <param name="formatProvider">not used by this TypeConverter.</param> /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param> /// <returns> /// an instance of <see cref="DescriptionType" />, or <c>null</c> if there is no suitable conversion. /// </returns> public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DescriptionType.CreateFrom(sourceValue);
private void ConvertTypes(DescriptionType wsdl2, ServiceDescription wsdl1) { var types = wsdl2.Items.FirstOrDefault(s => s is TypesType) as TypesType; if (types == null) return; foreach (var e in types.Any) { var sc = new XmlDocument(); var scRoot = sc.ImportNode(e, true); if (scRoot.LocalName.ToLower() == "schema") { var s = XmlSchema.Read(new StringReader(scRoot.OuterXml), null); wsdl1.Types.Schemas.Add(s); } } }
private void ConvertBinding(DescriptionType wsdl2, ServiceDescription wsdl1) { var bindings = wsdl2.Items.Where(s => s is BindingType); foreach (BindingType b2 in bindings) { var b1 = new Binding(); wsdl1.Bindings.Add(b1); b1.Name = b2.name; b1.Type = b2.@interface; var v = GetSoapVersion(b2); if (v == SoapVersion.Soap11) b1.Extensions.Add(new SoapBinding { Transport = "http://schemas.xmlsoap.org/soap/http" }); else b1.Extensions.Add(new Soap12Binding { Transport = "http://schemas.xmlsoap.org/soap/http" }); var operations = b2.Items.Where(s => s is BindingOperationType); foreach (BindingOperationType op2 in operations) { var op1 = new OperationBinding(); b1.Operations.Add(op1); op1.Name = [email protected]; var soap = v == SoapVersion.Soap11 ? new SoapOperationBinding() : new Soap12OperationBinding(); op1.Extensions.Add(soap); soap.SoapAction = FindSoapAction(op2); soap.Style = SoapBindingStyle.Document; var body = v == SoapVersion.Soap11 ? new SoapBodyBinding() : new Soap12BodyBinding(); body.Use = SoapBindingUse.Literal; op1.Input = new InputBinding(); op1.Input.Extensions.Add(body); op1.Output = new OutputBinding(); op1.Output.Extensions.Add(body); HandleHeaders(wsdl1, op2, ItemsChoiceType1.input, op1.Input, v); HandleHeaders(wsdl1, op2, ItemsChoiceType1.output, op1.Output, v); } } }
public void Add(int orderid, string orderStatus, string deliveryStatus, string installStatus, string logisticTaskStatus, DescriptionType descriptionType) { ParameterChecker.CheckNull(orderStatus, "orderStatus"); ParameterChecker.CheckNull(deliveryStatus, "deliveryStatus"); ParameterChecker.CheckNull(installStatus, "installStatus"); ParameterChecker.CheckNull(logisticTaskStatus, "logisticTaskStatus"); try { _handler.Add(orderid, orderStatus, deliveryStatus, installStatus, logisticTaskStatus, descriptionType); } catch (TuhuBizException) { throw; } catch { } }
public ShowDescriptionComponent(string name, TWEntity entity, DescriptionType descriptionType) : base(name) { Entity = entity; DescriptionType = descriptionType; }
private void ConvertImports(DescriptionType wsdl2, ServiceDescription wsdl1) { var imports = wsdl2.Items.Where(s => s is ImportType); foreach (ImportType i in imports) { string loc = i.location; InvokeDocumentReference(ref loc); wsdl1.Imports.Add(new Import() { Namespace = i.@namespace, Location = loc }); } var includes = wsdl2.Items.Where(s => s is IncludeType); foreach (IncludeType i in includes) { string loc = i.location; InvokeDocumentReference(ref loc); wsdl1.Imports.Add(new Import() { Location = loc }); } }
/// <summary> /// /// </summary> /// <param name="orderid">订单号</param> /// <param name="orderStatus">订单状态</param> /// <param name="deliveryStatus">配送状态</param> /// <param name="installStatus">安装状态</param> /// <param name="logisticTaskStatus">物流状态</param> /// <param name="descriptionType">描述类型</param> /// <returns></returns> public void Add(int orderid, string orderStatus, string deliveryStatus, string installStatus, string logisticTaskStatus, DescriptionType descriptionType) { //获取描述类型 var desType = GetEnumDesc(descriptionType); var tblOrderTrackingLog = new OrderTrackingLogEntity { OrderId = orderid, OrderStatus = orderStatus, DeliveryStatus = deliveryStatus, InstallStatus = installStatus, LogisticTaskStatus = logisticTaskStatus, CreateTime = DateTime.Now, IsOver = descriptionType.Equals(DescriptionType.Delivery3Received) || descriptionType.Equals(DescriptionType.Install2Installed) }; if (!string.IsNullOrEmpty(desType)) { string desCription; //获取配置好的描述 XmlDataSource.NodeCollection.TryGetValue(desType, out desCription); tblOrderTrackingLog.Description = desCription; } _dbManager.Execute(conn => DalOrderTrackingLog.Add(conn, tblOrderTrackingLog)); }
private string getDescription(string name, DescriptionType type) { XElement[] elements = this.members.Elements().Where(elem => elem.Attributes().First().Value.Substring(2).Equals(name)).ToArray(); if(elements.Length>0) { if(type == DescriptionType.Detailed) { string returnString = ""; XElement[] insideElements = elements.Elements().ToArray(); foreach (var item in insideElements) { if (item.Name == "summary" && !String.IsNullOrEmpty(item.Value)) { returnString += item.Value.Replace("\n",string.Empty).Replace(" ",string.Empty) + '\n'; } else if (item.Name == "param" && !String.IsNullOrEmpty(item.Value)) { returnString += item.FirstAttribute.Value.Replace("\n", string.Empty).Replace(" ", string.Empty) + ": "; returnString += item.Value.Replace("\n", string.Empty).Replace(" ", string.Empty) + '\n'; } else if (item.Name == "returns" && !String.IsNullOrEmpty(item.Value)) { returnString += "Return: \n"; returnString += item.Value.Replace("\n", string.Empty).Replace(" ", string.Empty) + '\n'; } } return returnString; } else { XElement[] insideElements = elements.Elements().ToArray(); foreach (var item in insideElements) { if(item.Name == "summary") { return item.Value.Replace("\n", string.Empty).Replace(" ", string.Empty); } } } } else if (elements.Length>1) { Log(LogKind.Error, "More than 1 line found."); } return null; }
public CreditNoteLineType[] getCreditNoteLine() { CreditNoteLineType HILT = new CreditNoteLineType(); CreditNoteLineType[] MILT = new CreditNoteLineType[VD.li]; for (int i = 0; i < VD.li; ++i) { MILT[i] = new CreditNoteLineType(); IDType HIT = new IDType(); HIT.Value = (i + 1).ToString(); MILT[i].ID = HIT; CreditedQuantityType HIQT = new CreditedQuantityType(); HIQT.unitCode = Interface["LnUndMed" + (i + 1)]; HIQT.unitCodeSpecified = true; HIQT.Value = Interface["LnCantidad" + (i + 1)]; MILT[i].CreditedQuantity = HIQT; LineExtensionAmountType HLEAT = new LineExtensionAmountType(); HLEAT.currencyID = Interface["Tmoneda"]; HLEAT.Value = Interface["LnValVta" + (i + 1)]; MILT[i].LineExtensionAmount = HLEAT; PricingReferenceType HPRT = new PricingReferenceType(); PricingReferenceType[] MRPT = { HPRT, HPRT }; PriceType HPCT = new PriceType(); PriceType[] MPCT = null; PriceAmountType HXPT = new PriceAmountType(); if (Interface["LnCodAfecIGV" + (i + 1)] == "10" || Interface["LnCodAfecIGV" + (i + 1)] == "20" || Interface["LnCodAfecIGV" + (i + 1)] == "30" || Interface["LnCodAfecIGV" + (i + 1)] == "40") { MPCT = new PriceType[] { new PriceType() { PriceAmount = new PriceAmountType() { currencyID = Interface["Tmoneda"], Value = Interface["LnMntPrcVta" + (i + 1)] }, PriceTypeCode = new PriceTypeCodeType() { Value = "01" } } }; } else { MPCT = new PriceType[] { new PriceType() { PriceAmount = new PriceAmountType() { currencyID = Interface["Tmoneda"], Value = "0.00" }, PriceTypeCode = new PriceTypeCodeType() { Value = "01" } }, new PriceType() { PriceAmount = new PriceAmountType() { currencyID = Interface["Tmoneda"], Value = Interface["LnMntPrcVta" + (i + 1)] }, PriceTypeCode = new PriceTypeCodeType() { Value = "02" } }, }; } MRPT[0].AlternativeConditionPrice = MPCT; MILT[i].PricingReference = MRPT[0]; // TAX TOTAL double o = 0; double.TryParse(Interface["LnMntISC" + (i + 1)], out o); var igvPercent = Interface["LnIgvPercentage" + (i + 1)]; if (igvPercent == null || igvPercent.Length == 0) { igvPercent = "18.00"; } if (o > 0) { MILT[i].TaxTotal = new TaxTotalType[] { new TaxTotalType() { TaxAmount = new TaxAmountType() { currencyID = Interface["Tmoneda"], Value = Interface["LnMntIGV" + (i + 1)] }, TaxSubtotal = new TaxSubtotalType[] { new TaxSubtotalType() { TaxableAmount = new TaxableAmountType() { currencyID = Interface["Tmoneda"], Value = "0.00" }, TaxAmount = new TaxAmountType() { currencyID = Interface["Tmoneda"], Value = Interface["LnMntIGV" + (i + 1)] }, Percent = new PercentType() { //credit note igv //Value = "18.00" Value = igvPercent }, TaxCategory = new TaxCategoryType() { TaxExemptionReasonCode = new TaxExemptionReasonCodeType() { Value = Interface["LnCodAfecIGV" + (i + 1)] }, TaxScheme = new TaxSchemeType() { ID = new IDType() { Value = "1000" }, Name = new NameType1() { Value = "IGV" }, TaxTypeCode = new TaxTypeCodeType() { Value = "VAT" } } } } } }, new TaxTotalType() { TaxAmount = new TaxAmountType() { currencyID = Interface["Tmoneda"], Value = Interface["LnMntISC" + (i + 1)] }, TaxSubtotal = new TaxSubtotalType[] { new TaxSubtotalType() { TaxableAmount = new TaxableAmountType() { currencyID = Interface["Tmoneda"], Value = "0.00" }, TaxAmount = new TaxAmountType() { currencyID = Interface["Tmoneda"], Value = Interface["LnMntISC" + (i + 1)] }, TaxCategory = new TaxCategoryType() { TaxExemptionReasonCode = new TaxExemptionReasonCodeType() { Value = "" }, TierRange = new TierRangeType() { Value = Interface["LnCodSisISC" + (i + 1)] }, TaxScheme = new TaxSchemeType() { ID = new IDType() { Value = "2000" }, Name = new NameType1() { Value = "ISC" }, TaxTypeCode = new TaxTypeCodeType() { Value = "EXC" } } } } } } }; } else { MILT[i].TaxTotal = new TaxTotalType[] { new TaxTotalType() { TaxAmount = new TaxAmountType() { currencyID = Interface["Tmoneda"], Value = Interface["LnMntIGV" + (i + 1)] }, TaxSubtotal = new TaxSubtotalType[] { new TaxSubtotalType() { TaxableAmount = new TaxableAmountType() { currencyID = Interface["Tmoneda"], Value = "0.00" }, TaxAmount = new TaxAmountType() { currencyID = Interface["Tmoneda"], Value = Interface["LnMntIGV" + (i + 1)] }, Percent = new PercentType() { //Credit note igv //Value = "18.00" Value = igvPercent }, TaxCategory = new TaxCategoryType() { TaxExemptionReasonCode = new TaxExemptionReasonCodeType() { Value = Interface["LnCodAfecIGV" + (i + 1)] }, TaxScheme = new TaxSchemeType() { ID = new IDType() { Value = "1000" }, Name = new NameType1() { Value = "IGV" }, TaxTypeCode = new TaxTypeCodeType() { Value = "VAT" } } } } } } }; } // PRICE HPCT = null; HPCT = new PriceType(); HXPT = null; HXPT = new PriceAmountType(); HXPT.currencyID = Interface["Tmoneda"]; HXPT.Value = Interface["LnValUnit" + (i + 1)]; HPCT.PriceAmount = HXPT; MILT[i].Price = HPCT; // ITEM ItemType HIMT = new ItemType(); DescriptionType HDT = new DescriptionType(); DescriptionType[] MDT = { HDT }; MDT[0].Value = "<![CDATA[" + Interface["LnDescrip" + (i + 1)] + "]]>"; ItemIdentificationType HIIT = new ItemIdentificationType(); HIT = null; HIT = new IDType(); HIT.Value = "<![CDATA[" + Interface["LnCodProd" + (i + 1)] + "]]>"; HIIT.ID = HIT; HIMT.Description = MDT; HIMT.SellersItemIdentification = HIIT; MILT[i].Item = HIMT; } return(MILT); }
public static string GetDescriptionTypeString(DescriptionType descriptionType) { switch (descriptionType) { case DescriptionType.Brief: return "briefdescription"; case DescriptionType.Detailed: return "detaileddescription"; default: throw new ArgumentException("Unsupported description type."); } }
public static string GetSymbolDescriptionAndCatchExceptionIntoMarkdownErrors(string path, string originalUserEntry, DescriptionType descriptionType, TransformationData transformationDataForThisRun, Markdown parser, HashSet<string> foundSymbolPaths = null) { var outputText = ""; var isError = false; var isInfo = false; var errorId = 0; try { var match = SymbolPathPattern.Match(path); if (!match.Success) { throw new InvalidDoxygenPath(path); } var symbolPath = match.Groups["symbolPath"].Value; var overloadSpec = match.Groups["overloadSpecification"].Value; var symbol = DoxygenDbCache.GetSymbolFromPath(symbolPath); if (foundSymbolPaths != null) { foundSymbolPaths.Add(symbolPath); } if (symbol.IsOverloadedMember) { if (string.IsNullOrWhiteSpace(overloadSpec)) { throw new DoxygenAmbiguousSymbolException(path, symbol.GetOverloadSpecificationOptions()); } outputText = symbol.GetSymbolDescription(descriptionType, overloadSpec); } else { outputText = symbol.GetSymbolDescription(descriptionType); } } catch (Exception e) { errorId = transformationDataForThisRun.ErrorList.Count; transformationDataForThisRun.ErrorList.Add( Markdown.GenerateError( Language.Message("DoxygenQueryError", e.Message), MessageClass.Error, originalUserEntry, errorId, transformationDataForThisRun)); isError = true; // rethrowing if not known exception if (!(e is InvalidDoxygenPath) && !(e is SymbolNotFoundInDoxygenXmlFile) && !(e is DoxygenAmbiguousSymbolException)) { throw; } } if (parser.ThisIsPreview && (isInfo || isError)) { return Templates.ErrorHighlight.Render(Hash.FromAnonymousObject( new { errorId = errorId, errorText = outputText })); } return outputText; }
private void ConvertService(DescriptionType wsdl2, ServiceDescription wsdl1) { var services = wsdl2.Items.Where(s => s is ServiceType); foreach (ServiceType s2 in services) { var s1 = new Service(); wsdl1.Services.Add(s1); s1.Name = s2.name; foreach (EndpointType e2 in s2.Items) { var p1 = new Port(); s1.Ports.Add(p1); p1.Name = e2.name; p1.Binding = e2.binding; var sab = new SoapAddressBinding() { Location = e2.address }; var sab12 = new Soap12AddressBinding() { Location = e2.address }; p1.Extensions.Add(sab); p1.Extensions.Add(sab12); } } }
public ShowDescriptionComponent(string name, List <TWEntity>?entities, DescriptionType descriptionType) : base(name) { Entities = entities; DescriptionType = descriptionType; }
private void ConvertInterface(DescriptionType wsdl2, ServiceDescription wsdl1) { var interfaces = wsdl2.Items.Where(s => s is InterfaceType); foreach (InterfaceType i2 in interfaces) { var p1 = new PortType(); wsdl1.PortTypes.Add(p1); p1.Name = i2.name; if (i2.Items == null) continue; foreach (Object obj in i2.Items) { var op2 = obj as InterfaceOperationType; if (op2 == null) continue; var op1 = new Operation(); p1.Operations.Add(op1); op1.Name = op2.name; var msg2In = FindMessage(op2, ItemsChoiceType.input); var msg1In = CreateMessage(wsdl1, op1.Name + "_in", msg2In.element, "parametere"); op1.Messages.Add(new OperationInput() { Message = msg1In }); var msg2Out = FindMessage(op2, ItemsChoiceType.output); bool isOneWay = msg2Out == null; if (!isOneWay) { var msg1Out = CreateMessage(wsdl1, op1.Name + "_out", msg2Out.element, "parameters"); op1.Messages.Add(new OperationOutput() { Message = msg1Out }); } } } }
public static string GetSymbolDescriptionAndCatchExceptionIntoMarkdownErrors(string path, string originalUserEntry, DescriptionType descriptionType, TransformationData transformationDataForThisRun, Markdown parser, HashSet <string> foundSymbolPaths = null) { var outputText = ""; var isError = false; var isInfo = false; var errorId = 0; try { var match = SymbolPathPattern.Match(path); if (!match.Success) { throw new InvalidDoxygenPath(path); } var symbolPath = match.Groups["symbolPath"].Value; var overloadSpec = match.Groups["overloadSpecification"].Value; var symbol = DoxygenDbCache.GetSymbolFromPath(symbolPath); if (foundSymbolPaths != null) { foundSymbolPaths.Add(symbolPath); } if (symbol.IsOverloadedMember) { if (string.IsNullOrWhiteSpace(overloadSpec)) { throw new DoxygenAmbiguousSymbolException(path, symbol.GetOverloadSpecificationOptions()); } outputText = symbol.GetSymbolDescription(descriptionType, overloadSpec); } else { outputText = symbol.GetSymbolDescription(descriptionType); } } catch (Exception e) { errorId = transformationDataForThisRun.ErrorList.Count; transformationDataForThisRun.ErrorList.Add( Markdown.GenerateError( Language.Message("DoxygenQueryError", e.Message), MessageClass.Error, originalUserEntry, errorId, transformationDataForThisRun)); isError = true; // rethrowing if not known exception if (!(e is InvalidDoxygenPath) && !(e is SymbolNotFoundInDoxygenXmlFile) && !(e is DoxygenAmbiguousSymbolException)) { throw; } } if (parser.ThisIsPreview && (isInfo || isError)) { return(Templates.ErrorHighlight.Render(Hash.FromAnonymousObject( new { errorId = errorId, errorText = outputText }))); } return(outputText); }
private void ConvertDescription(DescriptionType wsdl2, ServiceDescription wsdl1) { wsdl1.TargetNamespace = wsdl2.targetNamespace; }
public static OOBDataSource marshalODS(DataSource ds, String odsString) { String[] odsFields = odsString.Split(','); String key = null; String name = null; String id = null; String useiconstring = null; Boolean useicon = false; String uid = null; String hf = null; String df = null; String baseDesc = null; String baseLabel = null; String dtstring = null; String[] lflds = null; String[] dflds = null; foreach (String f in odsFields) { String[] vals = f.Split(':'); if (vals[0].Equals("KEY")) { key = vals[1]; } if (vals[0].Equals("NAME")) { name = vals[1]; } if (vals[0].Equals("ID")) { id = vals[1]; } if (vals[0].Equals("USEICON")) { useiconstring = vals[1]; if (useiconstring.ToLower().Equals("true")) { useicon = true; } } if (vals[0].Equals("UIDFLD")) { uid = vals[1]; } if (vals[0].Equals("HFFLD")) { hf = vals[1]; } if (vals[0].Equals("LBLFLDS")) { lflds = vals[1].Split('|'); } if (vals[0].Equals("DESCFLD")) { df = vals[1]; } if (vals[0].Equals("BASEDESC")) { baseDesc = vals[1]; } if (vals[0].Equals("BASELABEL")) { baseLabel = vals[1]; } if (vals[0].Equals("DESCTYPE")) { dtstring = vals[1]; } if (vals[0].Equals("DESCFLDS")) { dflds = vals[1].Split('|'); } } OOBDataSource ods = new OOBDataSource(ds, key); ods.UIDField = uid; ods.HFField = hf; ods.DescField = df; ods.UseIcon = useicon; foreach (KeyValuePair <String, String> p in ods.Tokens) { baseDesc = baseDesc.Replace(p.Key, p.Value); } ods.BaseDescription = baseDesc; foreach (KeyValuePair <String, String> p in ods.Tokens) { baseLabel = baseLabel.Replace(p.Key, p.Value); } ods.BaseLabel = baseLabel; DescriptionType dtype = DescriptionType.None; if (dtstring.Equals("None")) { dtype = DescriptionType.None; } else if (dtstring.Equals("SingleField")) { dtype = DescriptionType.SingleField; } else if (dtstring.Equals("Custom")) { dtype = DescriptionType.Custom; } ods.DescType = dtype; if (lflds != null) { foreach (String l in lflds) { ods.LabelFields.Add(l); } } if (dflds != null) { foreach (String l in dflds) { ods.DescriptionFields.Add(l); } } return(ods); }
private void ConvertDescription(DescriptionType wsdl2, ServiceDescription wsdl1) { wsdl1.TargetNamespace = wsdl2.targetNamespace; }
public void AddOrderTrackingLog(int orderid, string orderStatus, string deliveryStatus, string installStatus, string logisticTaskStatus, DescriptionType descriptionType) { var parms = new object[] { orderid, orderStatus ?? string.Empty, deliveryStatus ?? string.Empty, installStatus ?? string.Empty, logisticTaskStatus ?? string.Empty, descriptionType }; TuHuThreadPool.QueueUserWorkItem(HandlerAddOrderTrackingLog, parms); }
void LlenarDetalle(En_ComprobanteElectronico Comprobante, ref DebitNoteType debitNote) { List <DebitNoteLineType> oListaDetalle = new List <DebitNoteLineType>(); foreach (En_ComprobanteDetalle oDet in Comprobante.ComprobanteDetalle) { List <DescriptionType> oListaDescripcion = new List <DescriptionType>(); DescriptionType oDescripcion = new DescriptionType(); oDescripcion.Value = oDet.Descripcion; oListaDescripcion.Add(oDescripcion); foreach (string oDes in oDet.MultiDescripcion) { DescriptionType oDescrip = new DescriptionType(); oDescrip.Value = oDes.ToString(); oListaDescripcion.Add(oDescrip); } List <TaxSubtotalType> oListaSubtotal = new List <TaxSubtotalType>(); foreach (En_ComprobanteDetalleImpuestos odetImpuesto in oDet.ComprobanteDetalleImpuestos) { TaxSubtotalType oSubTotal = new TaxSubtotalType(); oSubTotal = LlenarSubTotalDetalle(odetImpuesto.MontoBase, odetImpuesto.MontoTotalImpuesto, Comprobante.Moneda.Trim(), odetImpuesto.Porcentaje, odetImpuesto.CodigoInternacionalTributo, odetImpuesto.NombreTributo, odetImpuesto.CodigoTributo, odetImpuesto.AfectacionIGV); oListaSubtotal.Add(oSubTotal); } DebitNoteLineType oInvoiceLine = new DebitNoteLineType { ID = new IDType { Value = oDet.Item.ToString() }, DebitedQuantity = new DebitedQuantityType { unitCode = oDet.UnidadMedida.Trim().ToUpper(), unitCodeListAgencyName = "United Nations Economic Commission for Europe", unitCodeListID = "UN/ECE rec 20", Value = oDet.Cantidad }, LineExtensionAmount = new LineExtensionAmountType { Value = oDet.Total, currencyID = Comprobante.Moneda.Trim() }, PricingReference = new PricingReferenceType { AlternativeConditionPrice = new PriceType[] { new PriceType { PriceAmount = new PriceAmountType { Value = oDet.ValorVentaUnitarioIncIgv, currencyID = Comprobante.Moneda.Trim() }, PriceTypeCode = new PriceTypeCodeType { Value = oDet.CodigoTipoPrecio, listAgencyName = "PE:SUNAT", listName = "Tipo de Precio", listURI = "urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo16" } } } }, TaxTotal = new TaxTotalType[] { new TaxTotalType { TaxAmount = new TaxAmountType { Value = oDet.ImpuestoTotal, currencyID = Comprobante.Moneda.Trim() }, TaxSubtotal = oListaSubtotal.ToArray() } }, Price = new PriceType { PriceAmount = new PriceAmountType { Value = oDet.ValorVentaUnitario, currencyID = Comprobante.Moneda.Trim() } }, Item = new ItemType { Description = oListaDescripcion.ToArray(), SellersItemIdentification = new ItemIdentificationType { ID = new IDType { Value = oDet.Codigo } }, CommodityClassification = new CommodityClassificationType[] { new CommodityClassificationType { CommodityCode = new CommodityCodeType { listAgencyName = "GS1 US", listID = "UNSPSC", listName = "Item Classification", Value = oDet.CodigoSunat } } } } }; oListaDetalle.Add(oInvoiceLine); } ; debitNote.DebitNoteLine = oListaDetalle.ToArray(); }
public abstract string Description(DescriptionType type);
public PlugInDescriptionAttribute(DescriptionType descriptionType, string value) { m_type = descriptionType; m_value = value; }
public Description(string name, DescriptionType descriptionType) { Name = name; DescriptionType = descriptionType; }