/// <summary> /// Copia los horarios de tour por Lead Source, sala de ventas y dia de la semana de un Lead Source a otro /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [vku] 29/Jun/2016 Created /// </history> private async void btnCopyToLeadSource_Click(object sender, RoutedEventArgs e) { if (!ValidateHelper.ValidateRequired(cboLeadSource, "lead source (FROM)")) { return; } else { if (!ValidateHelper.ValidateRequired(cboLeadSourceTo, "lead source (TO)")) { return; } else { if (UIHelper.ShowMessage("Are you sure you want to copy the tour times of the Lead Source " + "\"" + cboLeadSource.Text + "\"" + " to the Lead Source " + "\"" + cboLeadSourceTo.Text + "\"" + "?", MessageBoxImage.Question) == MessageBoxResult.Yes) { if (_enumTourTimes == EnumTourTimesSchema.ttsByLeadSourceSalesRoom) { await BRTourTimes.CopyTourTimesByLeadSourceSalesRoomToLeadSource(cboLeadSource.SelectedValue.ToString(), cboLeadSourceTo.SelectedValue.ToString()); } else { await BRTourTimes.CopyTourTimesByLeadSourceSalesRoomWeekDayToLeadSource(cboLeadSource.SelectedValue.ToString(), cboLeadSourceTo.SelectedValue.ToString()); } } } } }
/// <summary> /// Copia los horarios de tour por Lead Source, sala de ventas y dia de la semana de un Lead Source a /// todos los Lead Sources del mismo programa /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [vku] 29/Jun/2016 Created /// </history> private async void btnCopyToLeadSourcesOfProgram_Click(object sender, RoutedEventArgs e) { if (!ValidateHelper.ValidateRequired(cboLeadSource, "lead source")) { return; } else { string strProgram; strProgram = await BRPrograms.GetProgram(cboLeadSource.SelectedValue.ToString()); if (UIHelper.ShowMessage("Are you sure you want to copy the tour times of the Lead Source " + "\"" + cboLeadSource.Text + "\"" + " to all others Lead Sources of Program " + "\"" + strProgram + "\"" + "?", MessageBoxImage.Question) == MessageBoxResult.Yes) { if (_enumTourTimes == EnumTourTimesSchema.ttsByLeadSourceSalesRoom) { await BRTourTimes.CopyTourTimesByLeadSourceSalesRoomToLeadSourcesOfProgram(cboLeadSource.SelectedValue.ToString()); } else { await BRTourTimes.CopyTourTimesByLeadSourceSalesRoomWeekDayToLeadSourcesOfProgram(cboLeadSource.SelectedValue.ToString()); } } } }
/// <summary> /// Copia los horarios de tour por Lead Source, sala de ventas y dia de la semana de un Lead Source, /// sala de ventas y dia de la semana a todas las salas de ventas y dias de la semana del mismo Lead Source /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [vku] 29/Jun/2016 Created /// </history> private async void btnCopyToSalesRoomsWeekDaysOfLeadSource_Click(object sender, RoutedEventArgs e) { if (!ValidateHelper.ValidateRequired(cboLeadSource, "lead source")) { return; } else { if (!ValidateHelper.ValidateRequired(cboSalesRoom, "sales room")) { return; } else { if (!ValidateHelper.ValidateRequired(cboWeekDay, "week day")) { return; } else { if (UIHelper.ShowMessage("Are you sure you want to copy the tour times of the Lead Source " + "\"" + cboLeadSource.Text + "\"" + ", Sales Room " + "\"" + cboSalesRoom.Text + "\"" + ", Week Day " + "\"" + cboWeekDay.Text + "\"" + " to all others Sales Rooms & Week Days of Lead Source " + "\"" + cboLeadSource.Text + "\"" + "?", MessageBoxImage.Question) == MessageBoxResult.Yes) { await BRTourTimes.CopyTourTimesByLeadSourceSalesRoomWeekDayToSalesRoomsWeekDaysOfLeadSource(cboLeadSource.SelectedValue.ToString(), cboSalesRoom.SelectedValue.ToString(), cboWeekDay.SelectedValue.ToString()); } } } } }
/// <summary> /// Carga los horarios de Tours /// </summary> /// <history> /// [vku] 21/Jun/2016 Created /// </history> protected async void LoadListTourTimes() { string ttls = string.Empty, ttsr = string.Empty; int ttday = 0; try { status.Visibility = Visibility.Visible; string sMsj = ValidateHelper.ValidateForm(this, "Tour Times"); if (sMsj == "") { ttls = (string)cboLeadSource.SelectedValue; ttday = Convert.ToInt32(cboWeekDay.SelectedValue); ttsr = (string)cboSalesRoom.SelectedValue; TourTimes _lstTourTimes = await BRTourTimes.GetTourTimes(_enumTourTimes, ttls, ttsr, ttday); TourTimes lstTourTimes = await BRTourTimes.GetTourTimes(_enumTourTimes, ttls, ttsr, ttday); switch (_enumTourTimes) { case EnumTourTimesSchema.ttsByLeadSourceSalesRoom: _tourTimes = _lstTourTimes.TourTimeByLeadSourceSalesRoom; dgrTourTimes.DataContext = lstTourTimes.TourTimeByLeadSourceSalesRoom; dgrTourTimes.ItemsSource = lstTourTimes.TourTimeByLeadSourceSalesRoom; break; case EnumTourTimesSchema.ttsByLeadSourceSalesRoomWeekDay: _tourTimeByDay = _lstTourTimes.TourTimeByLeadSourceSalesRoomWeekDay; dgrTourTimes.DataContext = lstTourTimes.TourTimeByLeadSourceSalesRoomWeekDay; dgrTourTimes.ItemsSource = lstTourTimes.TourTimeByLeadSourceSalesRoomWeekDay; break; case EnumTourTimesSchema.ttsBySalesRoomWeekDay: _tourTimeBySalesRoomWeekDay = _lstTourTimes.TourTimeBySalesRoomWeekDay; dgrTourTimes.DataContext = lstTourTimes.TourTimeBySalesRoomWeekDay; dgrTourTimes.ItemsSource = lstTourTimes.TourTimeBySalesRoomWeekDay; break; } StatusBarReg.Content = dgrTourTimes.Items.Count - 1 + " Tour Times."; status.Visibility = Visibility.Collapsed; } } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Copia los horarios de tour por Lead Source, sala de ventas y dia de la semana de una sala de ventas /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [vku] 29/Jun/2016 Created /// </history> private async void btnCopyToSalesRoom_Click(object sender, RoutedEventArgs e) { if (!ValidateHelper.ValidateRequired(cboSalesRoom, "sales room (FROM)")) { return; } else { if (!ValidateHelper.ValidateRequired(cboSalesRoomTo, "sales room (TO)")) { return; } else { if (UIHelper.ShowMessage("Are you sure you want to copy the tour times of the Sales Room " + "\"" + cboSalesRoom.Text + "\"" + " to the Sales Room " + "\"" + cboSalesRoomTo.Text + "\"" + "?", MessageBoxImage.Question) == MessageBoxResult.Yes) { switch (_enumTourTimes) { case EnumTourTimesSchema.ttsByLeadSourceSalesRoom: await BRTourTimes.CopyTourTimesByLeadSourceSalesRoomToSalesRoom(cboSalesRoom.SelectedValue.ToString(), cboSalesRoomTo.SelectedValue.ToString()); break; case EnumTourTimesSchema.ttsByLeadSourceSalesRoomWeekDay: await BRTourTimes.CopyTourTimesByLeadSourceSalesRoomWeekDayToSalesRoom(cboSalesRoom.SelectedValue.ToString(), cboSalesRoomTo.SelectedValue.ToString()); break; case EnumTourTimesSchema.ttsBySalesRoomWeekDay: await BRTourTimes.CopyTourTimesBySalesRoomWeekDayToSalesRoom(cboSalesRoom.SelectedValue.ToString(), cboSalesRoomTo.SelectedValue.ToString()); break; } } } } }