Пример #1
0
        public OMSDataResult ReadMainOmsData()
        {
            var res = new OMSDataResult();

            try
            {
                var omsData = new OMSData();
                omsData.Init();
                res.Result = ReadMainOMSData(ref omsData);
                if (res.Result == 0)
                {
                    res.Ogrn     = omsData.OGRN;
                    res.Okato    = omsData.OKATO;
                    res.DateFrom = DateTime.ParseExact(omsData.InsuranceDate, "yyyyMMdd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
                    res.DateTo   = DateTime.ParseExact(omsData.InsuranceEndDate, "yyyyMMdd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
                }
                res.ErrorString = GetErrorString(res.Result);
            }
            catch (Exception ex)
            {
                res.ErrorString = ex.Message;
            }

            return(res);
        }
Пример #2
0
        public OperationResult WriteOmsData(string lastName, string firstName, string middleName, string birthDate, string ogrn, string okato, string dateFrom, string dateTo)
        {
            var res = new OperationResult();

            try
            {
                OMSData omsData = new OMSData
                {
                    LastName         = lastName,
                    FirstName        = firstName,
                    MiddleName       = middleName,
                    BirthDate        = string.IsNullOrEmpty(birthDate) ? string.Empty : DateTime.ParseExact(birthDate, "dd.MM.yyyy", CultureInfo.InvariantCulture).ToString("yyyyMMdd"),
                    OGRN             = ogrn,
                    OKATO            = okato,
                    InsuranceDate    = string.IsNullOrEmpty(dateFrom) ? string.Empty : DateTime.ParseExact(dateFrom, "dd.MM.yyyy", CultureInfo.InvariantCulture).ToString("yyyyMMdd"),
                    InsuranceEndDate = string.IsNullOrEmpty(dateTo) ? string.Empty : DateTime.ParseExact(dateTo, "dd.MM.yyyy", CultureInfo.InvariantCulture).ToString("yyyyMMdd"),
                };

                res.Result      = WriteOMSData(ref omsData);
                res.ErrorString = GetErrorString(res.Result);
            }
            catch (Exception ex)
            {
                res.ErrorString = ex.Message;
            }

            return(res);
        }
Пример #3
0
 public static extern uint ReadMainOMSData([In][Out] ref OMSData omsData);
Пример #4
0
 public static extern uint WriteOMSData([In] ref OMSData omsData);