protected void PhoneCallsHistoryFilter(object sender, DirectEventArgs e) { List <PhoneCall> phoneCallsHistory = new List <PhoneCall>(); if (FilterTypeComboBox.SelectedItem.Index > -1) { int filterType = Convert.ToInt32(FilterTypeComboBox.SelectedItem.Value); phoneCallsHistory = Global.DATABASE.PhoneCalls.GetChargeableCallsBySipAccount(sipAccount) .Where(phoneCall => phoneCall.AcInvoiceDate != DateTime.MinValue && (!string.IsNullOrEmpty(phoneCall.AcIsInvoiced) && phoneCall.AcIsInvoiced == "YES")) .ToList(); //Business filter if (filterType == 2) { phoneCallsHistory = phoneCallsHistory.Where(phonecall => phonecall.UiCallType == "Business").ToList(); } //Personal filter else if (filterType == 3) { phoneCallsHistory = phoneCallsHistory.Where(phonecall => phonecall.UiCallType == "Personal").ToList(); } } PhoneCallsHistoryGrid.GetStore().LoadData(phoneCallsHistory); }
protected void PhoneCallStore_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { var phoneCallsHistory = Global.DATABASE.PhoneCalls.GetChargeableCallsBySipAccount(sipAccount) .Where(phoneCall => phoneCall.AcInvoiceDate != DateTime.MinValue && (!string.IsNullOrEmpty(phoneCall.AcIsInvoiced) && phoneCall.AcIsInvoiced == "YES")) .ToList(); PhoneCallsHistoryGrid.GetStore().DataSource = phoneCallsHistory; PhoneCallsHistoryGrid.GetStore().DataBind(); } }