Exemple #1
0
        private void button1_Click_2(object sender, EventArgs e)
        {
            string RegisterConnectionString = "Data Source=80.250.173.142;Initial Catalog=Readers;Persist Security Info=True;User ID=demo;Password=demo;Connect Timeout=1200";

            ALISReaderRemote.ReaderRemote re      = new ALISReaderRemote.ReaderRemote(RegisterConnectionString);
            PreRegisterRemoteReader       request = new PreRegisterRemoteReader();

            request.BirthDate   = "1985-05-05";
            request.CountryId   = 2;
            request.Email       = "*****@*****.**";
            request.FamilyName  = "Кулеба";
            request.FatherName  = "Александрович";
            request.MobilePhone = "79869852171";
            request.Name        = "Максим";
            request.Password    = "******";
            DateTime BirthDate;

            if (!DateTime.TryParseExact(request.BirthDate, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out BirthDate))
            {
                tbResponse.Text = "Дата в неверном формате";
            }
            try
            {
                re.RegSendEmailAndSaveTemp(request.FamilyName, request.Name, request.FatherName, BirthDate, request.Email, request.CountryId, request.MobilePhone, request.Password);
            }
            catch (Exception ex)
            {
                tbResponse.Text = ex.Message;
            }
        }
Exemple #2
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            string RegisterConnectionString = "Data Source=80.250.173.142;Initial Catalog=Readers;Persist Security Info=True;User ID=demo;Password=demo;Connect Timeout=1200";

            ALISReaderRemote.ReaderRemote re = new ALISReaderRemote.ReaderRemote(RegisterConnectionString);
            DateTime BirthDate   = new DateTime(1985, 5, 5);
            int      CountryId   = 137;
            string   Email       = "*****@*****.**";
            string   FamilyName  = "Кулеба";
            string   FatherName  = "Александрович";
            string   MobilePhone = "+7(986)9852171";
            string   Name        = "Максим";
            string   Password    = "******";

            try
            {
                re.RegSendEmailAndSaveTemp(FamilyName, Name, FatherName, BirthDate, Email, CountryId, MobilePhone, Password);
            }
            catch (Exception ex)
            {
                tbResponse.Text = ex.Message;//входная строка имела неверный формат.
            }
        }