Exemplo n.º 1
0
        private void btnSaveCallLog_Click(object sender, EventArgs e)
        {
            /**
             * https://brightvision.jira.com/browse/PLATFORM-2789
             * DAN.4.19.2013: Commented as jeff advice that even though currently on call, will need to auto stop the calling and proceed to saving.
             */
            if (UserOnCall())
                UserOnCallForceStop();

            #region Old Code
            //if (tbxContactFirstname.Text.Length < 1 || tbxContactLastname.Text.Length < 1) {
            //    MessageBox.Show("Firstname / Lastname is required.", "Add Call Log", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            //    return;
            //}
            //else if (tbxContactFirstname.Text.Equals("First name") || tbxContactLastname.Text.Equals("Last name")) {
            //    MessageBox.Show("Firstname / Lastname is required.", "Add Call Log", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            //    return;
            //}

            //WaitDialog.Show("Saving ...");
            //if (EndCall_Initiated != null)
            //    EndCall_Initiated(this, new EventArgs());

            //if (StartTime.ToString().Equals("00:00:00"))
            //    EndTime = new TimeSpan();

            //int? _ContactId = null;
            //if (ContactPerson != null)
            //    if (ContactPerson.id > 0)
            //        _ContactId = ContactPerson.id;

            //string _ContactName = (string.Format("{0} {1}", tbxContactFirstname.Text, tbxContactLastname.Text)).Equals("Call Log") ? "Switchboard" : string.Format("{0} {1}", tbxContactFirstname.Text, tbxContactLastname.Text);
            //event_followup_log _efeCallLog = new event_followup_log() {
            //    subcampaign_id = SubCampaignId,
            //    account_id = AccountId,
            //    contact_id = _ContactId,
            //    title = tbxContactTitle.Text,
            //    contact_no = CallLogBarParams == null? "": CallLogBarParams.ContactNo,
            //    short_message = tbxShortMessage.Text,
            //    event_type = "Call Log",
            //    event_status = cboCallStatus.Text,
            //    date_of_transaction = DateTime.Now,
            //    assigned_user = UserSession.CurrentUser.UserId,
            //    done = true,
            //    start_time = StartTime,
            //    end_time = EndTime,
            //    date_created = DateTime.Now,
            //    created_by = UserSession.CurrentUser.UserId,
            //    contact_name = _ContactName,
            //    audio_id = AudioId
            //};

            //BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection);
            //_efDbContext.event_followup_log.AddObject(_efeCallLog);
            //_efDbContext.SaveChanges();
            #endregion

            WaitDialog.Show("Saving ...");
            event_followup_log  _efeCallLog = this.SaveCallLog(true);
            this.TriggerWindowsAzureStorageBlobApplication();
            var args = new SaveCallLogArgs { Id = _efeCallLog.id, CallMethod = _efeCallLog.call_method };
            if (btnSaveCallLog_OnClick != null)
                btnSaveCallLog_OnClick(sender, args);
            WaitDialog.Close();
        }
Exemplo n.º 2
0
        private void btnSaveCallLog_Click(object sender, EventArgs e)
        {
            if (tbxContactFirstname.Text.Length < 1 || tbxContactLastname.Text.Length < 1) {
                MessageBox.Show("Firstname / Lastname is required.", "Add Call Log", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            else if (tbxContactFirstname.Text.Equals("First name") || tbxContactLastname.Text.Equals("Last name")) {
                MessageBox.Show("Firstname / Lastname is required.", "Add Call Log", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }

            WaitDialog.Show("Saving data...");
            this.EndClock();
            if (EndCall_Initiated != null)
                EndCall_Initiated(this, new EventArgs());

            int? _ContactId = null;
            if (ContactPerson != null)
                if (ContactPerson.id > 0)
                    _ContactId = ContactPerson.id;

            string _ContactName = (string.Format("{0} {1}", tbxContactFirstname.Text, tbxContactLastname.Text)).Equals("Call Log") ? "Switchboard" : string.Format("{0} {1}", tbxContactFirstname.Text, tbxContactLastname.Text);
            event_followup_log newevent_followup_log = new event_followup_log() {
                            subcampaign_id = SubCampaignId,
                            account_id = AccountId,
                            contact_id = _ContactId,
                            title = tbxContactTitle.Text,
                            contact_no = CallLogBarParams.ContactNo,
                            short_message = tbxShortMessage.Text,
                            event_type = "Call Log",
                            event_status = cboCallStatus.Text,
                            date_of_transaction = DateTime.Now,
                            assigned_user = UserSession.CurrentUser.UserId,
                            done = true,
                            start_time = m_StartTime,
                            end_time = m_EndTime,
                            date_created = DateTime.Now,
                            created_by = UserSession.CurrentUser.UserId,
                            contact_name = _ContactName,
                            audio_id = m_AudioId
                        };
            m_efDbContext.event_followup_log.AddObject(newevent_followup_log);
            m_AudioId = Guid.Empty;
            m_CallLogSaved = true;
            int id = newevent_followup_log.id;
            m_efDbContext.SaveChanges();
            var args = new SaveCallLogArgs { Id = newevent_followup_log.id };
            if (btnSaveCallLog_OnClick != null)
                btnSaveCallLog_OnClick(sender, args);

            this.Default();
            WaitDialog.Close();
        }
Exemplo n.º 3
0
        private void btnDiscard_Click(object sender, EventArgs e)
        {
            if (UserOnCall()) {
                NotificationDialog.Information("Bright Sales", "Phone call is in progress.");
                return;
            }

            WaitDialog.Show("Saving ...");
            event_followup_log _efeCallLog = this.SaveCallLog(false);
            TriggerWindowsAzureStorageBlobApplication();
            var args = new SaveCallLogArgs { Id = _efeCallLog.id };
            if (btnSaveCallLog_OnClick != null)
                btnSaveCallLog_OnClick(sender, args);
            WaitDialog.Close();
        }