示例#1
0
    protected void btnEnter_Click(object sender, EventArgs e)
    {
        TeenvioAPI api = new TeenvioAPI (txtUser.Text, txtPlan.Text, txtPassword.Text);

        try{
            api.getServerVersion ();
            MainWindow win = new MainWindow();
            win.Show();
            win.setAPI(api);
            this.Destroy();

        }catch(TeenvioException ex){
            MessageDialog msg = new MessageDialog (this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, ex.Message);
            msg.Title = "Error";

            ResponseType response = (ResponseType) msg.Run();
            if (response == ResponseType.Close || response == ResponseType.DeleteEvent) {
                msg.Destroy();
            }
        }catch(Exception ex){
            MessageDialog msg = new MessageDialog (this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, ex.Message);
            msg.Title = "Error";

            ResponseType response = (ResponseType) msg.Run();
            if (response == ResponseType.Close || response == ResponseType.DeleteEvent) {
                msg.Destroy();
            }
        }
    }
示例#2
0
        public void onLoad(object sender, EventArgs args)
        {
            //**************************************
            //   Change this auth-data!
            //**************************************

            // user.plan: two parts from teenvio login separated by .
            api = new TeenvioAPI("user","plan","pass");

            //***************************************
            //    Set the HTTP Method: GET or POST
            //***************************************
            api.useMethodGET();
            //api.useMethodPOST();

            if (listBox1.SelectedValue.Length > 0) {
                this.currentIdCampaign = int.Parse(listBox1.SelectedValue);
            }
        }