protected void CustomizeStats_QuartersStore_Load(object sender, EventArgs e) { if (!Ext.Net.X.IsAjaxRequest) { CustomizeStats_Quarters.GetStore().DataSource = SpecialDateTime.GetQuartersOfTheYear(); CustomizeStats_Quarters.GetStore().DataBind(); } }
protected void CustomizeStats_YearStore_Load(object sender, EventArgs e) { //Get years from the database List <SpecialDateTime> Years = Global.DATABASE.UsersCallsSummaries.GetYearsBySipAccount(sipAccount); //Add a custom year criteria SpecialDateTime CustomYear = SpecialDateTime.Get_OneYearAgoFromToday(); Years.Reverse(); //i.e. 2015, 2014, 2013 Years.Add(CustomYear); //2015, 2014, 2013, "ONEYEARAGO..." Years.Reverse(); //"ONEYEARAGO...", 2013, 2014, 2015 //Bind the data CustomizeStats_Years.GetStore().DataSource = Years; CustomizeStats_Years.GetStore().DataBind(); }
protected void SubmitCustomizeStatisticsBtn_Click(object sender, DirectEventArgs e) { //Submitted from the view int filterYear, filterQuater; //For DateTime handling DateTime startingDate, endingDate; string titleText = string.Empty; if (CustomizeStats_Years.SelectedItem.Index > -1 && CustomizeStats_Quarters.SelectedItem.Index > -1) { filterYear = Convert.ToInt32(CustomizeStats_Years.SelectedItem.Value); filterQuater = Convert.ToInt32(CustomizeStats_Quarters.SelectedItem.Value); //Construct the Date Range titleText = SpecialDateTime.ConstructDateRange(filterYear, filterQuater, out startingDate, out endingDate); //Re-bind DurationCostChart to match the filter dates criteria DurationCostChart.GetStore().LoadData(this.GetDurationChartData(startingDate, endingDate)); DurationCostChartPanel.Title = String.Format("Business/Personal Calls - {0}", titleText); var chartData = Global.DATABASE.ChartsReports.GetByUser(sipAccount, startingDate, endingDate); if (chartData.Count > 0) { //Re-bind PhoneCallsDuartionChart to match the filter dates criteria PhoneCallsDuartionChart.GetStore().LoadData(chartData); PhoneCallsDuartionChartPanel.Title = String.Format("Calls Duration - {0}", titleText); //Re-bind PhoneCallsCostChart to match the filter dates criteria PhoneCallsCostChart.GetStore().LoadData(chartData); PhoneCallsCostChartPanel.Title = String.Format("Calls Costs - {0}", titleText); } else { PhoneCallsDuartionChart.GetStore().RemoveAll(); PhoneCallsCostChart.GetStore().RemoveAll(); } } //End-if } //End-Function