void Register(object sender)
        {
            var    ws      = new OnlineVideos.OnlineVideosWebservice.OnlineVideosService();
            string msg     = null;
            var    success = ws.RegisterEmail(Email, out msg);

            MessageBox.Show(msg, success ? Translation.Instance.Success : Translation.Instance.Error, MessageBoxButton.OK, success ? MessageBoxImage.Information : MessageBoxImage.Error);
        }
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(tbxEmail.Text) || !emailRegex.IsMatch(tbxEmail.Text))
     {
         MessageBox.Show("Please enter a valid Email!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     try
     {
         OnlineVideosWebservice.OnlineVideosService ws = new OnlineVideos.OnlineVideosWebservice.OnlineVideosService();
         string msg = "";
         bool success = ws.RegisterEmail(tbxEmail.Text, out msg);
         MessageBox.Show(msg, success ? "Success" : "Error", MessageBoxButtons.OK, success ? MessageBoxIcon.Information : MessageBoxIcon.Error);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }        
Esempio n. 3
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(tbxEmail.Text) || !emailRegex.IsMatch(tbxEmail.Text))
     {
         MessageBox.Show("Please enter a valid Email!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     try
     {
         OnlineVideosWebservice.OnlineVideosService ws = new OnlineVideos.OnlineVideosWebservice.OnlineVideosService();
         string msg     = "";
         bool   success = ws.RegisterEmail(tbxEmail.Text, out msg);
         MessageBox.Show(msg, success ? "Success" : "Error", MessageBoxButtons.OK, success ? MessageBoxIcon.Information : MessageBoxIcon.Error);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 void Register(object sender)
 {
     var ws = new OnlineVideos.OnlineVideosWebservice.OnlineVideosService();
     string msg = null;
     var success = ws.RegisterEmail(Email, out msg);
     MessageBox.Show(msg, success ? Translation.Instance.Success : Translation.Instance.Error, MessageBoxButton.OK, success ? MessageBoxImage.Information : MessageBoxImage.Error);
 }