/// <summary> /// Carga los catalogos de los combos /// </summary> /// <history> /// [vku] 22/Jun/2016 Created /// </history> protected async void LoadCatalogs() { try { List <TourTimesSchema> lstTourTimesSchemas = await BRTourTimesSchemas.GetTourTimesSchemas(nStatus : 1); List <LeadSourceByUser> lstLeadSourceByUser = await BRLeadSources.GetLeadSourcesByUser((Context.User.User.peID)); List <SalesRoomByUser> lstSalesRoomByUser = await BRSalesRooms.GetSalesRoomsByUser((Context.User.User.peID)); List <WeekDay> lstWeekDays = await BRWeekDays.GetWeekDays("EN"); int tourTimesSchema = await BRConfiguration.GetTourTimesSchema(); cboSchema.SelectedValue = tourTimesSchema; cboSchema.ItemsSource = lstTourTimesSchemas; cboLeadSource.ItemsSource = lstLeadSourceByUser; cboSalesRoom.ItemsSource = lstSalesRoomByUser; cboWeekDay.ItemsSource = lstWeekDays; cboLeadSourceTo.ItemsSource = lstLeadSourceByUser; cboSalesRoomTo.ItemsSource = lstSalesRoomByUser; EnableCopy(); LoadListTourTimes(); } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Cierra el show de Invitaciones en la fecha seleccionada por el usuario /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [vku] 16/Jun/2016 Created /// </history> private async void btnCloseShows_Click(object sender, RoutedEventArgs e) { if (ValidateCloseInvitationDate()) { try { btnCloseShows.Focus(); if (closeInvit == lastClosedDate) { Close(); } else { MessageBoxResult result = UIHelper.ShowMessage("Are you sure you want to close all Invitations until " + closeInvit.ToLongDateString() + " ? " + "You won’t be able to modifiy that Invitations anymore.", MessageBoxImage.Question, "Close Invitation"); if (result == MessageBoxResult.Yes) { int nRes = 0; nRes = await BRConfiguration.SaveCloseDate(closeInvit); UIHelper.ShowMessageResult("Close Invitation", nRes); if (nRes > 0) { Close(); } } } } catch (Exception ex) { UIHelper.ShowMessage(ex); } } }
/// <summary> /// Obtiene la ultima fecha /// </summary> /// <history> /// [vku] 16/Jun/2016 Created /// [erosado] 05/08/2016 Modified. Se agregó async. /// </history> protected async void GetCloseDate() { try { var result = await BRConfiguration.GetCloseDate(); lastClosedDate = (DateTime)result; dtpkLastClose.Value = lastClosedDate; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga el unico registro de configuration /// </summary> /// <history> /// [vku] 13/Jun/2016 Created /// </history> protected async void LoadConfigurations() { try { List <Configuration> lstConfigurations = await BRConfiguration.GetConfigurations(); configurations = (Configuration)lstConfigurations.FirstOrDefault(); ObjectHelper.CopyProperties(oldConfigurations, configurations); DataContext = configurations; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
private async Task LoadCloseDate() { var result = await BRConfiguration.GetCloseDate(); CloseDate = result; }