Skip to content

Instantly share code, notes, and snippets.

[Record]
public class ProtocolMapper : MapperBase
{
#region Protocols
[NamedOverloads(src, purchaseProtocolZK
, purchaseProtocolOSZ
, purchaseProtocolPAAE
, purchaseProtocolPAAE94FZ
, purchaseProtocolPAEP
[Record]
public class ProtocolMapperNew : MapperBase
{
#region Protocols
[NamedOverloads(src, purchaseProtocolZK
, purchaseProtocolOSZ
, purchaseProtocolPAAE
, purchaseProtocolPAAE94FZ
, purchaseProtocolPAEP
public static class EncodingHelper
{
static readonly ConcurrentDictionary<Encoding, Encoding> CheckEncodingCache =
new ConcurrentDictionary<Encoding, Encoding>();
static readonly ConcurrentDictionary<Encoding, Encoding> ReplaceEncodingCache =
new ConcurrentDictionary<Encoding, Encoding>();
static readonly Encoding EncodingCP1251 = Encoding.GetEncoding(1251);
[Mapping]
public class ProtocolMapper : MapperBase
{
#region Классы
class OfferResultType
{
public Result : OfferTypeMainInfoResult? { get; set; }
public AppRating : decimal? { get;set; }
public IsRejected : bool? { get; set; }
public static class ZipHelper
{
const string ZipExt = ".zip";
public class FileContent : IDisposable
{
public readonly string FileName;
public readonly string NameInArchive;
public readonly Stream Content;
open System
type Command =
| DoSomeStuff
| DoSomeOtherStuff
let tryParse str =
DoSomeStuff |> Some
let execute cmd =
budgetLevel(src : zfcs_budgetLevelType) : ContractTypeBudgetBudgetLevelType
{
//00– бюджет неуказывается
| zfcs_budgetLevelType.Item00 => ContractTypeBudgetBudgetLevelType.Undefined;
//01 - федеральный бюджет
| zfcs_budgetLevelType.Item01 => ContractTypeBudgetBudgetLevelType.FederalBudget;
//02 - бюджет субъекта Российской Федерации
| zfcs_budgetLevelType.Item02 => ContractTypeBudgetBudgetLevelType.SocialInsuranceFundBudget;
//03 - местный бюджет
| zfcs_budgetLevelType.Item03 => ContractTypeBudgetBudgetLevelType.LocalBudget;
[Overloads(src, Actual.zfcs_contract2015Type, Actual.zfcs_contractType
, Version_5_0.zfcs_contractType, Version_5_0.zfcs_contract2015Type
, Version_4_6.zfcs_contractType
, Version_4_3_1211.zfcs_contractType)]
public Contract(src : zfcs_contract2015Type) : ContractType
{
def foundation = foundationInfo(src.foundation);
def item = src.modification.ItemChoice;
def change = choice(item)
{
[Overloads(src, Actual.zfcs_contractCancelType, Actual.zfcs_contractCancel2015Type
, Version_5_0.zfcs_contractCancelType, Version_5_0.zfcs_contractCancel2015Type
, Version_4_6.zfcs_contractCancelType
, Version_4_3_1211.zfcs_contractCancelType)]
public ContractCancel(contract : ContractType, src : Actual.zfcs_contractCancel2015Type) : ContractType
{
contract <<-
{
CancelInfo <-
{
using System;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Xml;
namespace ConsoleApplication27
{
class Program
{
static void Main(string[] args)