/// <summary> /// Carga y configuracion del grid de Personnel /// </summary> /// <param name="blnOnlyOneRegister"></param> /// <param name="blnPersonnel"></param> /// <param name="blnAllPersonnel"></param> /// <param name="program"></param> private async void LoadPersonnel(bool blnOnlyOneRegister, bool blnPersonnel, bool blnAllPersonnel, EnumProgram program) { if (!blnPersonnel) { pnlPersonnel.Visibility = Visibility.Collapsed; return; } grdPersonnel.SelectionMode = (blnOnlyOneRegister) ? DataGridSelectionMode.Single : DataGridSelectionMode.Extended; List <LeadSourceByUser> listLeadSourceByUsers = await BRLeadSources.GetLeadSourcesByUser(Context.User.User.peID, program); _lstPersonnel = await BRPersonnel.GetPersonnel(string.Join(",", listLeadSourceByUsers.Select(y => y.lsID)), roles : "PR", status : 0); grdPersonnel.ItemsSource = _lstPersonnel; chkAllPersonnel.IsChecked = blnAllPersonnel; chkAllPersonnel.IsEnabled = !blnOnlyOneRegister; if (!_frmIh._clsFilter.LstPersonnel.Any()) { return; } chkAllPersonnel.IsChecked = false; _frmIh._clsFilter.LstPersonnel.ForEach(c => grdPersonnel.SelectedItems.Add(_lstPersonnel.SingleOrDefault(x => x.peID == c))); if (grdPersonnel.SelectedItems.Count == grdPersonnel.Items.Count) { chkAllPersonnel.IsChecked = true; } }
/// <summary> /// Llena el grid de personnels /// </summary> /// <param name="personnel">objeto a seleccionar</param> /// <history> /// [emoguel] created 10/06/2016 /// </history> private async void LoadPersonnel(PersonnelShort personnel = null) { try { status.Visibility = Visibility.Visible; int nIndex = 0; List <PersonnelShort> lstPersonnels = await BRPersonnel.GetPersonnel(_leadSource, _salesRoom, _roles, _status, _permission , _relationalOperator, _enumPermission, _dept); dgrPersonnels.ItemsSource = lstPersonnels; if (lstPersonnels.Count > 0) { if (personnel != null) { personnel = lstPersonnels.Where(pe => pe.peID == personnel.peID).FirstOrDefault(); nIndex = lstPersonnels.IndexOf(personnel); } GridHelper.SelectRow(dgrPersonnels, nIndex); } else { btnDel.IsEnabled = false; } StatusBarReg.Content = lstPersonnels.Count + " Personnels"; status.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga e incializa las variables /// </summary> /// <history> /// [jorcanche] 02/02/2016 Created /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> private async void Window_Loaded(object sender, RoutedEventArgs e) { //Indicamos al statusbar que me muestre cierta informacion cuando oprimimos cierto teclado KeyboardHelper.CkeckKeysPress(StatusBarCap, Key.Capital); KeyboardHelper.CkeckKeysPress(StatusBarIns, Key.Insert); KeyboardHelper.CkeckKeysPress(StatusBarNum, Key.NumLock); //Cargamos los datos del huesped _guest = await BRGuests.GetGuest(_guestId); EnabledControls(true, true, false); //Cargamos los PR cbopnPR.ItemsSource = await BRPersonnel.GetPersonnel(Context.User.Location.loID, "ALL", "PR"); // desplegamos los datos del huesped txtguID.Text = _guest.guID.ToString(); txtguLastName1.Text = _guest.guLastName1; txtguFirstName1.Text = _guest.guFirstName1; txtguCheckInD.Text = _guest.guCheckInD.ToString("dd/MM/yyyy"); txtguCheckOutD.Text = _guest.guCheckOutD.ToString("dd/MM/yyyy"); //Cargamos el datagrid _pRNoteViewSource = (CollectionViewSource)FindResource("pRNoteViewSource"); _pRNoteViewSource.Source = await BRNotes.GetNoteGuest(_guestId); //Si no tiene ninguna nota se inhabilita el control if (dgNotes.Items.Count < 1) { btnShowInfo.IsEnabled = false; } }
/// <summary> ///Valida el TextBox Cuando Pierde el Focus /// </summary> /// <history> /// [jorcanche] created 07/04/2016 /// </history> private void txtpnPR_LostFocus(object sender, RoutedEventArgs e) { _searchPRbyTxt = true; if (txtpnPR.Text != string.Empty) { // validamos que el motivo de indisponibilidad exista en los activos var pr = BRPersonnel.GetPersonnelById(txtpnPR.Text); if (pr == null) { UIHelper.ShowMessage("The PR not exist"); txtpnPR.Text = string.Empty; txtpnPR.Focus(); } else { cbopnPR.SelectedValue = txtpnPR.Text; } } else { cbopnPR.SelectedIndex = -1; } //Si es el mismo usuario que esta actualmente logueado y si puso autosing entonces le agregamos la contraseña y la desencriptamos //de no ser así lo dejamos vacio Pass(); _searchPRbyTxt = false; }
private async void LoadControls() { _guest = await BRGuests.GetGuest(_guestId); cboguum.ItemsSource = await BRUnavailableMotives.GetUnavailableMotives(1); cboguPRAvail.ItemsSource = await BRPersonnel.GetPersonnel(Context.User.Location.loID, "ALL", "PR"); if (_guest.guPRAvail != null) { cboguPRAvail.SelectedValue = _guest.guPRAvail; } if (_guest.guum != 0) { cboguum.SelectedValue = _guest.guum; txtguum.Text = _guest.guum.ToString(); } chkguOriginAvail.IsChecked = _guest.guOriginAvail; chkguAvail.IsChecked = _guest.guAvail; chkguAvailBySystem.IsChecked = _guest.guAvailBySystem; txtguum.IsEnabled = cboguum.IsEnabled = cboguPRAvail.IsEnabled = btnCancel.IsEnabled = btnSave.IsEnabled = chkguOriginAvail.IsEnabled = chkguAvail.IsEnabled = txtguum.IsEnabled = cboguum.IsEnabled = false; btnEdit.IsEnabled = true; }
/// <summary> /// Carga los integrantes /// </summary> /// <history> /// [vku] 12/Jul/2016 Created /// </history> public async void LoadIntegrantes(TeamGuestServices team) { try { List <Personnel> lstPersonnel = await BRPersonnel.GetPersonnels(blnLiner : true); List <Personnel> lstPersonnelIni = await BRPersonnel.GetPersonnels(blnLiner : true); List <Personnel> lstliner = new List <Personnel>(); lstliner.AddRange(lstPersonnel); cboIntegrant.ItemsSource = lstPersonnel; cboLiner.ItemsSource = lstliner; _lstPersonnel = lstPersonnel.Where(pe => pe.peTeam == team.tgID && pe.peTeamType == EnumToListHelper.GetEnumDescription(EnumTeamType.TeamPRs) && pe.pePlaceID == team.tglo).ToList(); _lstOldPersonnel = lstPersonnelIni.Where(pe => pe.peTeam == team.tgID && pe.peTeamType == EnumToListHelper.GetEnumDescription(EnumTeamType.TeamPRs) && pe.pePlaceID == team.tglo).ToList(); //Cargamos la lista con los datos iniciales dgrIntegrants.ItemsSource = _lstPersonnel; StatusBarReg.Content = _lstPersonnel.Count + " Integrants."; status.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Abre la ventana detalle en modo "detalle" o "edición" dependiendo de sus permisos /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [emoguel] created 10/06/2016 /// </history> private async void Cell_DoubleClick(object sender, RoutedEventArgs e) { PersonnelShort personnelShort = (PersonnelShort)dgrPersonnels.SelectedItem; Personnel personnel = BRPersonnel.GetPersonnelById(personnelShort.peID); frmPersonnelDetail frmPersonnelDetail = new frmPersonnelDetail(); frmPersonnelDetail.Owner = this; frmPersonnelDetail.enumMode = (_blnEdit) ? EnumMode.Edit : EnumMode.ReadOnly; frmPersonnelDetail.oldPersonnel = personnel; if (frmPersonnelDetail.ShowDialog() == true) { int nIndex = 0; List <PersonnelShort> lstPersonnel = (List <PersonnelShort>)dgrPersonnels.ItemsSource; var persons = await BRPersonnel.GetPersonnel(idPersonnel : frmPersonnelDetail.personnel.peID); if (persons.Count > 0) { PersonnelShort person = persons.FirstOrDefault(); ObjectHelper.CopyProperties(personnelShort, person); //Actualizamos los datos lstPersonnel.Sort((x, y) => string.Compare(x.peN, y.peN)); //Ordenamos la lista nIndex = lstPersonnel.IndexOf(personnelShort); //Obtenemos la posición del registro } else { lstPersonnel.Remove(personnelShort);//Quitamos el registro } btnDel.IsEnabled = (lstPersonnel.Count > 0) ? _blnDel : false; dgrPersonnels.Items.Refresh(); //Actualizamos la vista GridHelper.SelectRow(dgrPersonnels, nIndex); //Seleccionamos el registro StatusBarReg.Content = lstPersonnel.Count + " Personnels."; //Actualizamos el contador } }
/// <summary> /// Elimina los registros seleccionados /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [emoguel] created 10/06/2016 /// </history> private async void btnDel_Click(object sender, RoutedEventArgs e) { try { Cursor = Cursors.Wait; if (dgrPersonnels.SelectedItems.Count > 0) { txtStatus.Text = "Deleting Data"; status.Visibility = Visibility.Visible; List <PersonnelShort> lstPersonnelsDel = dgrPersonnels.SelectedItems.OfType <PersonnelShort>().ToList(); MessageBoxResult msgResult = MessageBoxResult.No; #region MessageBox if (lstPersonnelsDel.Count == 1) { msgResult = UIHelper.ShowMessage("Are you sure you want to delete this Person?", MessageBoxImage.Question, "Delete"); } else { msgResult = UIHelper.ShowMessage("Are you sure you want to delete these Persons", MessageBoxImage.Question, "Delete"); } #endregion if (msgResult == MessageBoxResult.Yes) { int nRes = await BRPersonnel.DeletePersonnels(lstPersonnelsDel); if (nRes > 0) { if (lstPersonnelsDel.Count == 1) { UIHelper.ShowMessage("Person was Deleted."); } else { UIHelper.ShowMessage("Person were Deleted."); } List <PersonnelShort> lstPersonnel = (List <PersonnelShort>)dgrPersonnels.ItemsSource; lstPersonnel.RemoveAll(pe => lstPersonnelsDel.Contains(pe)); dgrPersonnels.Items.Refresh(); } } } else { UIHelper.ShowMessage("Please select a Person."); } } catch (Exception ex) { UIHelper.ShowMessage(ex); } finally { status.Visibility = Visibility.Collapsed; Cursor = Cursors.Arrow; } }
/// <summary> /// Carga y configuracion de Personnels. /// </summary> /// <history> /// [edgrodriguez] 23/May/2016 Created /// </history> private async void LoadPersonnel() { _personnels = await BRPersonnel.GetPersonnelAccess(); _personnels.Insert(0, new Personnel { peID = "ALL", peN = "ALL" }); cbPersonnel.ItemsSource = _personnels; cbPersonnel.SelectedIndex = 0; }
/// <summary> /// Llena el combobox de Boss /// </summary> /// <history> /// [emoguel] created 22/04/2016 /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> private async void LoadBoss() { try { List <PersonnelShort> lstPersonnel = await BRPersonnel.GetPersonnel(roles : "Boss"); cmbsrBoss.ItemsSource = lstPersonnel; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga los patrones /// </summary> /// <history> /// [vku] 13/Jun/2016 Created /// </history> protected async void LoadPersonelBoss() { try { List <PersonnelShort> lstPersonelBoss = await BRPersonnel.GetPersonnelByRole("BOSS"); cboocBoss.ItemsSource = lstPersonelBoss; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga los lideres de equipos /// </summary> /// <history> /// [vku] 11/Jul/2016 Created /// </history> public async void LoadPersonnelForLeader() { try { List <PersonnelShort> lstPersonnelForLeader = await BRPersonnel.GetPersonnel(status : 1); cbotgLeader.ItemsSource = lstPersonnelForLeader; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga el combobox de patrones /// </summary> /// <history> /// [emoguel] created 16/05/2016 /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> private async void LoadBoss() { try { List <PersonnelShort> lstBoss = await BRPersonnel.GetPersonnel(roles : EnumToListHelper.GetEnumDescription(EnumRole.Boss)); cmblsBoss.ItemsSource = lstBoss; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga el combobox de Prs /// </summary> /// <history> /// [emoguel] created 05/05/2016 /// </history> private async void LoadPrs() { try { List <PersonnelShort> lstPrs = await BRPersonnel.GetPersonnelByRole("PR"); cmbPersonnel.ItemsSource = lstPrs; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga los administradores /// </summary> /// <history> /// [vku] 13/Jun/2016 Created /// </history> protected async void LoadPersonelAdmin() { try { List <PersonnelShort> lstPersonelAdmin = await BRPersonnel.GetPersonnelByRole("ADMIN"); cboocAdminUser.ItemsSource = lstPersonelAdmin; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga los integrantes a transferir /// </summary> /// <history> /// [vku] 19/Jul/2016 Created /// </history> public async void LoadPersonnel() { List <Personnel> lstPersonnelFrom = await BRPersonnel.GetPersonnels(); List <Personnel> lstPersonnelTo = new List <Personnel>(); lstPersonnelTo.AddRange(lstPersonnelFrom); cboIntegrant.ItemsSource = lstPersonnelFrom; cboIntegrantTo.ItemsSource = lstPersonnelTo; _lstPersonnel.AddRange(_lstOldPersonnel); grdFrom.ItemsSource = _lstPersonnel; skpStatus.Visibility = Visibility.Collapsed; lblIntegrantFrom.Content = "Integrants: " + _lstPersonnel.Count; }
/// <summary> /// Funcion que recibe la instancia de /// </summary> /// <history> /// [vipacheco] 2-26-2016 Created /// [edgrodriguez] 27/02/2016 Modified /// [edgrodriguez] 29/02/2016 Modified /// [jorcanche] 01/03/2016 Modified (Se agrega el "Case" Location) /// [vipacheco] 01/03/2016 Modified --> Se agrego validacion case para Sales Room /// [erosado] 19/Mar/2016 Validamos que el _frmBase no sea null /// [jorcanche] 11/04/2016 Si chkAutoSign es verdadero desencriptamos el password y se guarda Y AutoSign se deja como verdadero /// [erosado] 26/04/2016 Se restructuro el evento y se optimizo el codigo. /// </history> private void btnAceptar_Click(object sender, RoutedEventArgs e) { //Validar que el usuario meta toda la informacion requerida para el Login var msj = ValidateHelper.ValidateForm(this, "Login"); if (string.IsNullOrEmpty(msj)) { var _encryptPassword = EncryptHelper.Encrypt(txtPassword.Password); UserData = BRPersonnel.Login(_loginType, txtUser.Text, (cmbPlace.Visibility == Visibility.Visible) ? cmbPlace.SelectedValue.ToString() : ""); //Validar las credenciales del usuario sean correctas si devuelve 0 si tiene permiso. if (ValidateUserCredential(_encryptPassword) != 0) { return; } //Se valida que el usuario esta activo if (!UserData.User.peA) { UIHelper.ShowMessage("User ID is inactive.", MessageBoxImage.Error); txtUser.Focus(); return; } //Revisar si se desea cambiar el usuario o si se tiene el check cambiar pass activado. if (ChangePassword() != 0) { return; } //Validamos los Permisos y Roles necesarios para entrar if (ValidatePermissionAndRole() != 0) { return; } if (chkAutoSign.IsChecked.Value) { UserData.AutoSign = true; UserData.User.pePwd = EncryptHelper.Encrypt(UserData.User.pePwd); } IsAuthenticated = true; Close(); _splash?.Hide(); } else { UIHelper.ShowMessage(msj, MessageBoxImage.Warning); } }
/// <summary> ///Carga y configuracion del combo de Salesman /// </summary> /// <history> /// [ecanul] 14/06/2016 Created /// </history> private async void LoadSalesman() { _lstPersonnels.AddRange(await BRPersonnel.GetPersonnel("All", "All", new List <EnumRole> { EnumRole.PR, EnumRole.Liner, EnumRole.Closer, EnumRole.ExitCloser }.EnumListToString(), 1, "All", "=", EnumPermisionLevel.None, "All")); int index = _lstPersonnels.FindIndex(x => x.peID.Equals(frmPrs._clsFilter.Salesman?.peID)); if (index != -1) { cmbSalesman.SelectedIndex = index; } }
/// <summary> /// Carga al personal dependiendo del tipo de invitacion /// </summary> /// <param name="user">UserData</param> /// <param name="module">EnumModule</param> /// <history> /// [erosado] 09/08/2016 /// </history> private async Task LoadPersonnel(UserData user, EnumModule module) { List <PersonnelShort> personnel; //Si es Host carga al personal con la sala de venta if (module == EnumModule.Host) { personnel = await BRPersonnel.GetPersonnel(salesRooms : user.SalesRoom.srID, roles : "PR"); } //Si es cualquier otro lo hace con el leadSource else { personnel = await BRPersonnel.GetPersonnel(user.LeadSource.lsID, roles : "PR"); } Personnel = personnel; }
/// <summary> /// Llena los datos de Personnels /// </summary> /// <param name="deptID">Id del depto</param> /// <history> /// [emoguel] created 03/05/2016 /// </history> private async void LoadPersonnels(string deptID) { try { List <Personnel> lstAllPersonnels = await BRPersonnel.GetPersonnels(); cmbPersonnel.ItemsSource = lstAllPersonnels; _lstPersonel = lstAllPersonnels.Where(pe => pe.pede == deptID).ToList(); dgrPersonnel.ItemsSource = _lstPersonel; _lstOldPersonnel = lstAllPersonnels.Where(pe => pe.pede == deptID).ToList();//Cargamos la lista con los datos iniciales } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Obtiene los statistics del antiguo personnel /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [emoguel] created 24/06/2016 /// </history> private async void btnGetStaticsOld_Click(object sender, RoutedEventArgs e) { if (cmbPersonnelOld.SelectedValue != null) { idOldSelect = cmbPersonnelOld.SelectedValue.ToString(); lockButtons(false); txtStatus.Text = "Loading..."; PersonnelShort personnelShort = (PersonnelShort)cmbPersonnelOld.SelectedItem; PersonnelStatistics personnelStatistics = await BRPersonnel.GetPersonnelStatistics(personnelShort.peID); LoadStatistics(tvwOld, personnelStatistics, personnelShort); lockButtons(true); } else { UIHelper.ShowMessage("Please select a Personnel"); } }
/// <summary> /// Valida los datos del usuario /// </summary> /// <history> /// [edgrodriguez] 29/Feb/2016 Created /// [wtorres] 06/Jul/2016 Modified. Ahora se despliega un mensaje de error cuando la contraseña nueva /// es igual a la anterior /// </history> private void btnOK_Click(object sender, RoutedEventArgs e) { //Si los textbox se encuentran vacios. if (txtNewPwd.Password == string.Empty) { UIHelper.ShowMessage("Specify the New Password"); return; } if (txtConfirmNewPwd.Password == string.Empty) { UIHelper.ShowMessage("Please confirm the new password"); return; } //Si el password y la confirmacion son diferentes. if (!txtNewPwd.Password.Equals(txtConfirmNewPwd.Password)) { UIHelper.ShowMessage("New password and confirm password are different"); return; } // encriptamos la nueva contraseña string encryptPass = EncryptHelper.Encrypt(txtNewPwd.Password); //Si la nueva contraseña es igual a la anterior. if (userLogin.pePwd.Equals(encryptPass)) { UIHelper.ShowMessage("The new password can not be the same as the previous password"); return; } //Si ocurrio un error al cambiar el password. if (!BRPersonnel.ChangePassword(userLogin.peID, encryptPass, serverDate)) { UIHelper.ShowMessage("Could not change password"); return; } blnOk = true; userLogin.pePwd = encryptPass; userLogin.pePwdD = serverDate.Date; UIHelper.ShowMessage("Your password was changed succesfully"); Close(); }
/// <summary> /// Carga los combobox de personnel /// </summary> /// <history> /// [emoguel] created 24/06/2016 /// </history> private async void LoadPersonnel() { try { List <PersonnelShort> lstPersonnel = await BRPersonnel.GetPersonnel(status : 0); cmbPersonnelNew.ItemsSource = lstPersonnel; cmbPersonnelOld.ItemsSource = lstPersonnel; cmbPersonnelOld.SelectedValue = idOldSelect; if (!string.IsNullOrWhiteSpace(idOldSelect)) { btnGetStaticsOld_Click(null, null); } } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
private async void LoadFollwUp() { cboguPRFollow.IsEnabled = false; cboguPRFollow.ItemsSource = await BRPersonnel.GetPersonnel(Context.User.Location.loID, "ALL", "PR"); _guest = await BRGuests.GetGuest(_guestID); if (_guest.guFollowD.HasValue) { txtguFollowD.Text = _guest.guFollowD.Value.Date.ToString("dd-MM-yyyy"); } if (_guest.guPRFollow != string.Empty) { cboguPRFollow.SelectedValue = _guest.guPRFollow; } chkguFollow.IsChecked = _guest.guFollow; btnEdit.IsEnabled = true; btnSave.IsEnabled = btnCancel.IsEnabled = false; }
public bool Validate() { // validamos el PR if (!ValidateHelper.ValidateRequired(cboguPRFollow, "Unavailable PR", condition: true)) { return(false); } // validamos que el motivo de indisponibilidad exista Personnel PR = BRPersonnel.GetPersonnelById(cboguPRFollow.SelectedValue.ToString()); if (PR == null) { UIHelper.ShowMessage("The PR not exist"); cboguPRFollow.Focus(); return(false); } return(true); }
/// <summary> /// Obtiene los statistics del nuevo personnel /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [emoguel] created 24/06/2016 /// </history> private async void btnGetStaticsNew_Click(object sender, RoutedEventArgs e) { if (cmbPersonnelNew.SelectedValue != null) { idNewSelect = cmbPersonnelNew.SelectedValue.ToString(); lockButtons(false); status.Visibility = Visibility.Visible; txtStatus.Text = "Loading..."; PersonnelShort personnelShort = (PersonnelShort)cmbPersonnelNew.SelectedItem; PersonnelStatistics personnelStatistics = await BRPersonnel.GetPersonnelStatistics(personnelShort.peID); LoadStatistics(tvwNew, personnelStatistics, personnelShort); status.Visibility = Visibility.Collapsed; lockButtons(true); } else { UIHelper.ShowMessage("Please select a Personnel"); } }
/// <summary> /// Carga los integrantes /// </summary> /// <history> /// [vku] 23/Jul/2016 Created /// </history> public async void LoadIntegrantes(TeamSalesmen team) { try { List <Personnel> lstPersonnel = await BRPersonnel.GetPersonnels(blnLiner : true); cboIntegrant.ItemsSource = lstPersonnel; _lstPersonnel = lstPersonnel.Where(pe => pe.peTeam == team.tsID && pe.peTeamType == EnumToListHelper.GetEnumDescription(EnumTeamType.TeamSalesmen) && pe.pePlaceID == team.tssr).OrderBy(pe => pe.pepo).ThenBy(pe => pe.peN).ToList(); dgrIntegrants.ItemsSource = _lstPersonnel; List <Personnel> lstPersonnelIni = await BRPersonnel.GetPersonnels(); _lstOldPersonnel = lstPersonnelIni.Where(pe => pe.peTeam == team.tsID && pe.peTeamType == EnumToListHelper.GetEnumDescription(EnumTeamType.TeamSalesmen) && pe.pePlaceID == team.tssr).OrderBy(pe => pe.pepo).ThenBy(pe => pe.peN).ToList(); //Cargamos la lista con los datos iniciales StatusBarReg.Content = _lstPersonnel.Count + " Integrants."; status.Visibility = Visibility.Collapsed; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
/// <summary> /// Carga el combo de Personel y ChangedBy /// </summary> /// <history> /// [emoguel] 12/04/2016 /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> private async void LoadPersonnel() { try { List <PersonnelShort> lstPersonnel = await BRPersonnel.GetPersonnel(); if (enumMode == EnumMode.Search) { lstPersonnel.Insert(0, new PersonnelShort { peID = "", peN = "ALL" }); } cmbppChangedBy.ItemsSource = lstPersonnel; cmbpppe.ItemsSource = lstPersonnel; } catch (Exception ex) { UIHelper.ShowMessage(ex); } }
private async void LoadContact() { cboguPRInfo.ItemsSource = await BRPersonnel.GetPersonnel(_userPrimero.Location.loID, "ALL", "PR"); var guest = await BRGuests.GetGuest(_guestID); if (guest.guInfoD.HasValue) { txtguInfoD.Text = guest.guInfoD.Value.Date.ToString("dd-MM-yyyy"); } if (guest.guPRInfo != string.Empty) { cboguPRInfo.SelectedValue = guest.guPRInfo; } chkguInfo.IsChecked = guest.guInfo; btnEdit.IsEnabled = true; btnSave.IsEnabled = btnCancel.IsEnabled = false; cboguPRInfo.IsEnabled = false; Mouse.OverrideCursor = null; }
/// <summary> /// Obtiene la lista del personal /// </summary> /// <param name="leadSources">filtro leadsources</param> /// <param name="roles">rol del usuario loggeado</param> /// <history> /// [erosado] 22/Mar/2016 Created /// [erosado] 19/05/2016 Modified. Se agregó asincronía /// </history> public async void DoGetPersonnel(string leadSources, string roles) { try { var data = await BRPersonnel.GetPersonnel(leadSources, "ALL", roles); if (data.Count > 0) { data.Insert(0, new PersonnelShort() { peID = "ALL", peN = "ALL", deN = "ALL" }); cbxPersonnel.ItemsSource = data; } SetNewUserLogin(); StaEnd(); } catch (Exception ex) { UIHelper.ShowMessage(ex); } }