コード例 #1
0
        private void showCallPanel(bool p)
        {
            if (p)
            {
                btnLogin.Visible  = false;
                callPanel.Visible = true;

                // Expire olan token refreshlenince tetiklenecek method
                Authentication.Token.RefreshCallback += TokensRefreshed;
                List <Announcement> announcements = BulutfonApi.GetAnnouncements(Authentication.Token);
                announcementCombo.DataSource    = announcements;
                announcementCombo.DisplayMember = "name";
                announcementCombo.ValueMember   = "id";

                List <Did> dids = BulutfonApi.GetDids(Authentication.Token);

                didCombo.DataSource    = dids;
                didCombo.DisplayMember = "number";
                didCombo.ValueMember   = "number";
            }
            else
            {
                MessageBox.Show("Bir Hata Oluştu!");
            }
        }
コード例 #2
0
        public ActionResult OutgoingFaxes()
        {
            var   faxes = BulutfonApi.GetFaxes((Token)Session[Token.Key]);
            Token x     = (Token)Session[Token.Key];

            x.RefreshAccessToken();
            return(View(faxes));
        }
コード例 #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            // With Master Token
            button1.Enabled = false;
            button2.Enabled = false;
            Token token = new Token("MASTER TOKEN", "");

            dataGridView1.DataSource = BulutfonApi.GetDids(token);
        }
コード例 #4
0
 public ActionResult UploadFax(OutgoingFaxForm outgoingFax)
 {
     if (outgoingFax.attachment != null && outgoingFax.attachment.ContentLength > 0)
     {
         /*var ret =*/ BulutfonApi.SendFax((Token)Session[Token.Key],
                                           outgoingFax.attachment, // faks dosyası
                                           outgoingFax.receivers,  // alıcılar
                                           outgoingFax.did,        // gönderen numara
                                           outgoingFax.title);     // başlık
         // TODO: ret nesnesi üzerinden her bir alıcıya ait gönderme durumu raporlanabilir
     }
     return(RedirectToAction("OutgoingFaxes"));
 }
コード例 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            // With OAUTH 2
            string client_id     = "CLIENT_ID";
            string client_secret = "CLIENT_SECRET";
            var    loggedIn      = LoginForm.Login(
                client_id,
                client_secret,
                this);

            if (loggedIn)
            {
                button1.Enabled          = false;
                button2.Enabled          = false;
                dataGridView1.DataSource = BulutfonApi.GetDids(Authentication.Token);
            }
        }
コード例 #6
0
        private void makeCallButton_Click(object sender, EventArgs e)
        {
            string title           = txtTitle.Text.ToString();
            long   did             = Convert.ToInt64(didCombo.SelectedValue.ToString());
            string receivers       = txtReceivers.Text.ToString();
            int    announcement_id = Convert.ToInt32(announcementCombo.SelectedValue.ToString());

            AutomaticCallCreator auto = new AutomaticCallCreator();

            auto.title           = title;
            auto.did             = did;
            auto.receivers       = receivers;
            auto.announcement_id = announcement_id;
            ResponseAutomaticCall response = BulutfonApi.CreateAutomaticCall(Authentication.Token, auto);

            if (response.message != null)
            {
                txtTitle.Clear();
                txtReceivers.Clear();
                MessageBox.Show(response.message);
            }
        }
コード例 #7
0
        public ActionResult OutgoingFax(string id)
        {
            var fax = BulutfonApi.GetFax((Token)Session[Token.Key], id);

            return(View(fax));
        }
コード例 #8
0
        public ActionResult IncomingFaxes()
        {
            var faxes = BulutfonApi.GetIncomingFaxes((Token)Session[Token.Key]);

            return(View(faxes));
        }
コード例 #9
0
        public ActionResult Dids()
        {
            var dids = BulutfonApi.GetDids((Token)Session[Token.Key]);

            return(View(dids));
        }
コード例 #10
0
        public ActionResult Did(string id)
        {
            var did = BulutfonApi.GetDid((Token)Session[Token.Key], id);

            return(View(did));
        }
コード例 #11
0
 public ActionResult SendSms(RequestSendMessage message)
 {
     BulutfonApi.SendSms((Token)Session[Token.Key], message);
     return(RedirectToAction("Messages"));
 }
コード例 #12
0
        public ActionResult Message(string id)
        {
            var message = BulutfonApi.GetMessage((Token)Session[Token.Key], id);

            return(View(message));
        }
コード例 #13
0
        public ActionResult Messages()
        {
            var messages = BulutfonApi.GetMessages((Token)Session[Token.Key]);

            return(View(messages));
        }