/// <summary> /// Muestra la ventada detalle /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [emoguel] created 05/05/2016 /// </history> private void Cell_DoubleClick(object sender, RoutedEventArgs e) { PersonnelShort personnelShort = (PersonnelShort)dgrPRs.SelectedItem; frmFolioCXCPRDetail frmFolioDetail = new frmFolioCXCPRDetail(); frmFolioDetail.Owner = this; frmFolioDetail.enumMode = (_blnEdit)? EnumMode.Edit:EnumMode.ReadOnly; frmFolioDetail.personnel = personnelShort; frmFolioDetail.ShowDialog(); }
/// <summary> /// Abre la ventana de busqueda /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [emoguel] created 05/05/2016 /// </history> private void btnSearch_Click(object sender, RoutedEventArgs e) { frmFolioCXCPRDetail frmFolioDetail = new frmFolioCXCPRDetail(); frmFolioDetail.Owner = this; frmFolioDetail.personnel = _prFilter; frmFolioDetail.enumMode = EnumMode.Search; if (frmFolioDetail.ShowDialog() == true) { _prFilter = frmFolioDetail.personnel; LoadPR(); } }
/// <summary> /// Abre la ventana detalle en modo add /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [emoguel] created 05/05/2016 /// </history> private void btnAdd_Click(object sender, RoutedEventArgs e) { frmFolioCXCPRDetail frmFolioDetail = new frmFolioCXCPRDetail(); frmFolioDetail.Owner = this; frmFolioDetail.enumMode = EnumMode.Add; if (frmFolioDetail.ShowDialog() == true) { if (ValidateFilter(frmFolioDetail.personnel))//Verificamos que cumpla con los filtros actuales { List <PersonnelShort> lstPersonnel = (List <PersonnelShort>)dgrPRs.ItemsSource; lstPersonnel.Add(frmFolioDetail.personnel); //Agregamos el registro lstPersonnel.Sort((x, y) => string.Compare(x.peN, y.peN)); //Ordenamos la lista int nIndex = lstPersonnel.IndexOf(frmFolioDetail.personnel); //Obtenemos la posición dgrPRs.Items.Refresh(); //Actualizamos la vista GridHelper.SelectRow(dgrPRs, nIndex); //Seleccionamos el registro StatusBarReg.Content = lstPersonnel.Count + " PRs."; //Actualizamos el contador } } }