예제 #1
0
 public static TestBirthplace BuildBirthplaceFromDataBaseData(string idPerson)
 {
     using (SqlConnection connection = Global.GetSqlConnection())
     {
         string findIdAdresses = "SELECT TOP(1) * FROM mm_Person2Address WHERE IdAddress = (SELECT MAX(IdAddress) FROM mm_Person2Address WHERE IdPerson = '" + idPerson + "' AND IdAddressType = '" + 3 + "')";
         SqlCommand IdAddresses = new SqlCommand(findIdAdresses, connection);
         using (SqlDataReader addressesIdReader = IdAddresses.ExecuteReader())
         {
             while (addressesIdReader.Read())
             {
                 string id = (Convert.ToString(addressesIdReader["IdAddress"]));
                 using (SqlConnection connection2 = Global.GetSqlConnection())
                 {
                     string findIdAdresses2 = "SELECT TOP(1) * FROM Address WHERE IdAddress = '" + id + "'";
                     SqlCommand IdAddresses2 = new SqlCommand(findIdAdresses2, connection2);
                     using (SqlDataReader addressesReader = IdAddresses2.ExecuteReader())
                     {
                         BirthPlaceDto birthp = new BirthPlaceDto();
                         while (addressesReader.Read())
                         {
                             if (addressesReader["Country"].ToString() != "")
                                 birthp.Country = Convert.ToString(addressesReader["Country"]);
                             if (addressesReader["Region"].ToString() != "")
                                 birthp.Region = Convert.ToString(addressesReader["Region"]);
                             if (addressesReader["CityName"].ToString() != "")
                                 birthp.City = Convert.ToString(addressesReader["CityName"]);
                         }
                         return (new TestBirthplace(birthp));
                     }
                 }
             }
         }
     }
     return null;
 }
예제 #2
0
        private BirthPlaceDto GetBirthPlace()
        {
            var birthPlace = new BirthPlaceDto()
            {
                Country = "SomeCountry",
                Region  = "SomeRegion",
                City    = "SomeCity"
            };

            return(birthPlace);
        }
예제 #3
0
 static public TestBirthplace BuildBirthplaceFromDataBaseData(string idPerson)
 {
     using (SqlConnection connection = Global.GetSqlConnection())
     {
         string     findIdAdresses = "SELECT TOP(1) * FROM mm_Person2Address WHERE IdAddress = (SELECT MAX(IdAddress) FROM mm_Person2Address WHERE IdPerson = '" + idPerson + "' AND IdAddressType = '" + 3 + "')";
         SqlCommand IdAddresses    = new SqlCommand(findIdAdresses, connection);
         using (SqlDataReader addressesIdReader = IdAddresses.ExecuteReader())
         {
             while (addressesIdReader.Read())
             {
                 string id = (Convert.ToString(addressesIdReader["IdAddress"]));
                 using (SqlConnection connection2 = Global.GetSqlConnection())
                 {
                     string     findIdAdresses2 = "SELECT TOP(1) * FROM Address WHERE IdAddress = '" + id + "'";
                     SqlCommand IdAddresses2    = new SqlCommand(findIdAdresses2, connection2);
                     using (SqlDataReader addressesReader = IdAddresses2.ExecuteReader())
                     {
                         BirthPlaceDto birthp = new BirthPlaceDto();
                         while (addressesReader.Read())
                         {
                             if (addressesReader["Country"].ToString() != "")
                             {
                                 birthp.Country = Convert.ToString(addressesReader["Country"]);
                             }
                             if (addressesReader["Region"].ToString() != "")
                             {
                                 birthp.Region = Convert.ToString(addressesReader["Region"]);
                             }
                             if (addressesReader["CityName"].ToString() != "")
                             {
                                 birthp.City = Convert.ToString(addressesReader["CityName"]);
                             }
                         }
                         return(new TestBirthplace(birthp));
                     }
                 }
             }
         }
     }
     return(null);
 }
예제 #4
0
파일: UnitTest1.cs 프로젝트: nbIxMaN/EMKT
 public void AddFullPatient()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.DeathTime = new DateTime(2020, 02, 15);
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.IdBloodType = 1;
     patient.IdLivingAreaType = 1;
     patient.IdPatientMIS = "123456789010";
     patient.MiddleName = "Артемович";
     patient.Sex = 1;
     patient.SocialGroup = 2;
     patient.SocialStatus = "2.11";
     PixServise.DocumentDto document = new PixServise.DocumentDto();
     document.IdDocumentType = 14;
     document.DocS = "1311";
     document.DocN = "113131";
     document.ExpiredDate = new DateTime(1999, 11, 12);
     document.IssuedDate = new DateTime(2012, 11, 12);
     document.ProviderName = "УФМС";
     document.RegionCode = "1221";
     patient.Documents = new PixServise.DocumentDto[] { document };
     PixServise.AddressDto address = new PixServise.AddressDto();
     address.IdAddressType = 1;
     address.StringAddress = "Улица Ленина 47";
     address.Street = "01000001000000100";
     address.Building = "1";
     address.City = "0100000000000";
     address.Appartment = "1";
     address.PostalCode = 1;
     address.GeoData = "1";
     PixServise.AddressDto address2 = new PixServise.AddressDto();
     address2.IdAddressType = 2;
     address2.StringAddress = "Улица Партизанская 47";
     address2.Street = "01000001000000100";
     address2.Building = "1";
     address2.City = "0100000000000";
     address2.Appartment = "1";
     address2.PostalCode = 1;
     address2.GeoData = "1";
     patient.Addresses = new PixServise.AddressDto[] { address, address2 };
     BirthPlaceDto birthplace = new BirthPlaceDto();
     birthplace.City = "Тутинск";
     birthplace.Country = "маленькая";
     birthplace.Region = "БОЛЬШОЙ";
     patient.BirthPlace = birthplace;
     ContactDto contact = new ContactDto();
     contact.IdContactType = 1;
     contact.ContactValue = "89626959434";
     ContactDto contact2 = new ContactDto();
     contact2.IdContactType = 1;
     contact2.ContactValue = "89525959544";
     patient.Contacts = new ContactDto[] { contact, contact2 };
     PixServise.JobDto job = new PixServise.JobDto();
     job.OgrnCode = "0100000000000"; // некорректный код
     job.CompanyName = "OOO 'МИГ'";
     job.Sphere = "Я";
     job.Position = "Я";
     job.DateStart = new DateTime(2003, 1, 1);
     job.DateEnd = new DateTime(2004, 1, 1);
     patient.Job = job;
     PrivilegeDto privilege = new PrivilegeDto();
     privilege.DateStart = new DateTime(1993, 01, 02);
     privilege.DateEnd = new DateTime(2020, 01, 02);
     privilege.IdPrivilegeType = 10;
     patient.Privilege = privilege;
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
예제 #5
0
 public TestBirthplace(BirthPlaceDto b)
 {
     birthplace = b;
 }
예제 #6
0
 public TestBirthplace(BirthPlaceDto b)
 {
     birthplace = b;
 }
예제 #7
0
파일: UnitTest1.cs 프로젝트: nbIxMaN/EMKT
        public void AddFullPatient()
        {
            TestPixServiceClient client  = new TestPixServiceClient();
            PatientDto           patient = new PatientDto();

            patient.BirthDate        = new DateTime(1983, 01, 07);
            patient.DeathTime        = new DateTime(2020, 02, 15);
            patient.FamilyName       = "Жукин";
            patient.GivenName        = "Дмитрий";
            patient.IdBloodType      = 1;
            patient.IdLivingAreaType = 1;
            patient.IdPatientMIS     = "123456789010";
            patient.MiddleName       = "Артемович";
            patient.Sex          = 1;
            patient.SocialGroup  = 2;
            patient.SocialStatus = "2.11";
            PixServise.DocumentDto document = new PixServise.DocumentDto();
            document.IdDocumentType = 14;
            document.DocS           = "1311";
            document.DocN           = "113131";
            document.ExpiredDate    = new DateTime(1999, 11, 12);
            document.IssuedDate     = new DateTime(2012, 11, 12);
            document.ProviderName   = "УФМС";
            document.RegionCode     = "1221";
            patient.Documents       = new PixServise.DocumentDto[] { document };
            PixServise.AddressDto address = new PixServise.AddressDto();
            address.IdAddressType = 1;
            address.StringAddress = "Улица Ленина 47";
            address.Street        = "01000001000000100";
            address.Building      = "1";
            address.City          = "0100000000000";
            address.Appartment    = "1";
            address.PostalCode    = 1;
            address.GeoData       = "1";
            PixServise.AddressDto address2 = new PixServise.AddressDto();
            address2.IdAddressType = 2;
            address2.StringAddress = "Улица Партизанская 47";
            address2.Street        = "01000001000000100";
            address2.Building      = "1";
            address2.City          = "0100000000000";
            address2.Appartment    = "1";
            address2.PostalCode    = 1;
            address2.GeoData       = "1";
            patient.Addresses      = new PixServise.AddressDto[] { address, address2 };
            BirthPlaceDto birthplace = new BirthPlaceDto();

            birthplace.City    = "Тутинск";
            birthplace.Country = "маленькая";
            birthplace.Region  = "БОЛЬШОЙ";
            patient.BirthPlace = birthplace;
            ContactDto contact = new ContactDto();

            contact.IdContactType = 1;
            contact.ContactValue  = "89626959434";
            ContactDto contact2 = new ContactDto();

            contact2.IdContactType = 1;
            contact2.ContactValue  = "89525959544";
            patient.Contacts       = new ContactDto[] { contact, contact2 };
            PixServise.JobDto job = new PixServise.JobDto();
            job.OgrnCode    = "0100000000000"; // некорректный код
            job.CompanyName = "OOO 'МИГ'";
            job.Sphere      = "Я";
            job.Position    = "Я";
            job.DateStart   = new DateTime(2003, 1, 1);
            job.DateEnd     = new DateTime(2004, 1, 1);
            patient.Job     = job;
            PrivilegeDto privilege = new PrivilegeDto();

            privilege.DateStart       = new DateTime(1993, 01, 02);
            privilege.DateEnd         = new DateTime(2020, 01, 02);
            privilege.IdPrivilegeType = 10;
            patient.Privilege         = privilege;
            client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }