Exemplo n.º 1
0
        /// <summary>
        /// Evento que se encarga de generar las estadisticas
        /// </summary>
        /// <history>
        /// [erosado] 08/Mar/2016 Created
        /// </history>
        private void imgButtonOk_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            imgButtonOk.Focus();
            if (lsbxLeadSources.SelectedItems.Count > 0 && lsbxSalesRooms.SelectedItems.Count > 0 &&
                lsbxCountries.SelectedItems.Count > 0 && lsbxAgencies.SelectedItems.Count > 0 &&
                lsbxMarkets.SelectedItems.Count > 0)
            {
                if (DateHelper.ValidateValueDate(dtpkFrom, dtpkTo))
                {
                    filterTuple = new List <Tuple <string, string> >();
                    StaStart("Loading Data...");
                    imgButtonOk.IsEnabled = false;
                    filterTuple.Add(new Tuple <string, string>("DateRange", DateHelper.DateRange(dtpkFrom.Value.Value, dtpkTo.Value.Value)));
                    filterTuple.Add(new Tuple <string, string>("LeadSource", UsefulMethods.SelectedItemsIdToString(lsbxLeadSources)));
                    filterTuple.Add(new Tuple <string, string>("SalesRooms", UsefulMethods.SelectedItemsIdToString(lsbxSalesRooms)));
                    filterTuple.Add(new Tuple <string, string>("Countries", chbxCountries.IsChecked == true ? "ALL" : UsefulMethods.SelectedItemsIdToString(lsbxCountries)));
                    filterTuple.Add(new Tuple <string, string>("Agencies", chbxAgencies.IsChecked == true ? "ALL" : UsefulMethods.SelectedItemsIdToString(lsbxAgencies)));
                    filterTuple.Add(new Tuple <string, string>("Markets", chbxMarkets.IsChecked == true ? "ALL" : UsefulMethods.SelectedItemsIdToString(lsbxMarkets)));

                    DoGetRptPrStats(dtpkFrom.Value.Value, dtpkTo.Value.Value, filterTuple);
                }
            }
            else
            {
                UIHelper.ShowMessage("Select at least one item from each catalog ", MessageBoxImage.Warning);
            }
        }