示例#1
0
        public async Task <HttpResponseMessage> DeleteMessage()
        {
            //TODO: Add error handling.

            HttpResponseMessage httpResponse = new HttpResponseMessage();

            List <Voicemail> messageList = await voicemailBoxActor.GetMessagesAsync();

            if (messageList.Count < 1)
            {
                httpResponse.Content = new StringContent("Voicemail inbox is empty. Nothing to delete.", Encoding.UTF8, "text/html");
                return(httpResponse);
            }

            Voicemail vMail = messageList.OrderBy(item => item.ReceivedAt).First();

            await voicemailBoxActor.DeleteMessageAsync(vMail.Id);

            httpResponse.Content =
                new StringContent(
                    String.Format("Message Text: {0} <br/>Time Deleted: {1}.", vMail.Message, DateTime.Now.ToString()),
                    Encoding.UTF8,
                    "text/html");
            return(httpResponse);
        }
示例#2
0
        private void frmOrder_Load(object sender, System.EventArgs e)
        {
            this.Text += " - " + this.CompanyID;
            oRep       = new Rep(this.CompanyID);
            oVoicemail = new Voicemail(this.CompanyID);

            this.txtVoicemailID.Focus();
        }
示例#3
0
 private void Skype_VoicemailStatus(Voicemail voicemail, TVoicemailStatus status)
 {
     this.Logger.Debug(System.Reflection.MethodBase.GetCurrentMethod().Name);
 }
示例#4
0
//-------------------------------------------------------------------------------------------
    public void UpdatePage(string department)
    {
        using (WeavverEntityContainer data = new WeavverEntityContainer())
        {
            if (LoggedInUser.OrganizationId == SelectedOrganization.Id)
            {
                var tickets = (from x in data.CustomerService_Tickets
                               where x.Status != "Closed" &&
                               x.OrganizationId == SelectedOrganization.Id
                               select x);

                OpenTickets.Text = tickets.Count().ToString();

                var ticketstotal = (from x in data.CustomerService_Tickets
                                    where x.OrganizationId == SelectedOrganization.Id
                                    select x);

                TotalTickets.Text = ticketstotal.Count().ToString();
            }
            else
            {
                var tickets2 = (from x in data.CustomerService_Tickets
                                where x.Status != "Closed" &&
                                x.CustomerId.Value == LoggedInUser.OrganizationId
                                select x);

                OpenTickets.Text = tickets2.Count().ToString();

                var ticketstotal2 = (from x in data.CustomerService_Tickets
                                     where x.CustomerId.Value == LoggedInUser.OrganizationId
                                     select x);

                TotalTickets.Text = ticketstotal2.Count().ToString();
            }
        }

        try
        {
            string          freeswitchCS = ConfigurationManager.ConnectionStrings["freeswitch"].ConnectionString;
            MySqlConnection conn         = new MySqlConnection(freeswitchCS);
            conn.Open();
            MySqlCommand command = new MySqlCommand("select * from voicemail_msgs where username=?username order by created_epoch desc;", conn);
            command.Parameters.AddWithValue("?username", LoggedInUser.Username);
            MySqlDataReader reader = command.ExecuteReader();
            VoicemailList.DataSource = reader;
            VoicemailList.DataBind();
            reader.Close();

            command.CommandText = "select distinct in_folder from voicemail_msgs where username=?username;";
            reader = command.ExecuteReader();
            VoicemailFolders.DataTextField = "in_folder";
            VoicemailFolders.DataSource    = reader;
            VoicemailFolders.DataBind();
            reader.Close();

            conn.Close();

            Voicemail.Visible = (VoicemailFolders.Items.Count > 0);

            if (VoicemailList.Items.Count > 0)
            {
                Voicemail.FindControlR <Literal>("NoVoicemails").Visible = true;
            }
        }
        catch (MySqlException ex)
        {
            Voicemail.FindControlR <Literal>("NoVoicemails").Text    = "Could not load your voicemails, please try back later.";
            Voicemail.FindControlR <Literal>("NoVoicemails").Visible = true;
        }
    }
示例#5
0
        public void OurVoicemailStatus(Voicemail voicemail, TVoicemailStatus status)
        {
            // Always use try/catch with ANY Skype calls.
            try
            {
                // Write Voicemail Status to Window.
                AddTextToTextBox1(DateTime.Now.ToLocalTime() + ": " +
                 "Voicemail Status - Partner Handle: " + voicemail.PartnerHandle);

                // Example of checking length before adding to Window.
                if (voicemail.PartnerDisplayName.Length > 0) AddTextToTextBox1(" - Partner Display Name: " + voicemail.PartnerDisplayName);

                // Continue to write Voicemail Status to Window.
                AddTextToTextBox1(" - Converted TVoicemailStatus Status: " + skype.Convert.VoicemailStatusToText(status) +
                 " - TVoicemailStatus: " + status +
                 "\r\n");
            }
            catch (Exception e)
            {
                // Possibly old Skype4COM version, log an error, drop into debug if wanted.
                AddTextToTextBox1(DateTime.Now.ToLocalTime() + ": " +
                 "Voicemail Status Event Fired - Bad Text" +
                 " - Exception Source: " + e.Source + " - Exception Message: " + e.Message +
                 "\r\n");

                // If the "Use Auto Debug" check box is checked and we are in debug, drop into debug here when retry, otherwise, prompt for action.
                Debug.Assert(!this.UseAutoDebug.Checked);
            }
        }