Ejemplo n.º 1
0
        protected void FilterDisputedCallsBySite_Selecting(object sender, DirectEventArgs e)
        {
            int    siteID;
            string disputedCallsType = string.Empty;

            if (FilterDisputedCallsBySite.SelectedItem.Index > -1)
            {
                siteID = Convert.ToInt32(FilterDisputedCallsBySite.SelectedItem.Value);

                FilterDisputedCallsByType.Disabled = false;

                MarkAsAcceptedBtn.Disabled = false;
                MarkAsRejectedBtn.Disabled = false;

                if (FilterDisputedCallsByType.SelectedItem.Index > -1)
                {
                    disputedCallsType = Convert.ToString(FilterDisputedCallsByType.SelectedItem.Value);

                    ManageDisputedCallsGrid.GetStore().RemoveAll();
                    ManageDisputedCallsGrid.GetStore().DataSource = GetDisputedPhoneCalls(siteID, disputedCallsType);
                    ManageDisputedCallsGrid.DataBind();
                }
            }
            else
            {
                FilterDisputedCallsByType.Disabled = true;
            }
        }
Ejemplo n.º 2
0
        protected void RejectDispute(object sender, DirectEventArgs e)
        {
            RowSelectionModel sm = this.ManageDisputedCallsGrid.GetSelectionModel() as RowSelectionModel;

            string           json       = e.ExtraParams["Values"];
            List <PhoneCall> phoneCalls = new List <PhoneCall>();

            JavaScriptSerializer serializer = new JavaScriptSerializer();

            phoneCalls = serializer.Deserialize <List <PhoneCall> >(json);

            foreach (var phoneCall in phoneCalls)
            {
                phoneCall.AcDisputeStatus     = "Rejected";
                phoneCall.AcDisputeResolvedOn = DateTime.Now;
                phoneCall.UiCallType          = "Personal";
                phoneCall.UiMarkedOn          = DateTime.Now;
                phoneCall.UiUpdatedByUser     = sipAccount;

                Global.DATABASE.PhoneCalls.Update(phoneCall, phoneCall.PhoneCallsTableName);
            }

            ManageDisputedCallsGrid.GetSelectionModel().DeselectAll();

            //Rebind the data
            if (FilterDisputedCallsBySite.SelectedItem.Index > -1 && FilterDisputedCallsByType.SelectedItem.Index > -1)
            {
                var siteID = Convert.ToInt32(FilterDisputedCallsBySite.SelectedItem.Value);
                var selectedFilterValue = Convert.ToString(FilterDisputedCallsByType.SelectedItem.Value);

                ManageDisputedCallsGrid.GetStore().RemoveAll();
                ManageDisputedCallsGrid.GetStore().DataSource = GetDisputedPhoneCalls(siteID, selectedFilterValue);
                ManageDisputedCallsGrid.DataBind();
            }
        }