Ejemplo n.º 1
0
        /// <summary>
        /// Muestra la ventada detalle
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 07/05/2016
        /// </history>
        private void Cell_DoubleClick(object sender, RoutedEventArgs e)
        {
            PersonnelShort personnel = (PersonnelShort)dgrPRs.SelectedItem;
            frmFoliosInvitationsOuthousePRDetail frmFolioDetail = new frmFoliosInvitationsOuthousePRDetail();

            frmFolioDetail.Owner     = this;
            frmFolioDetail.personnel = personnel;
            frmFolioDetail.enumMode  = (_blnEdit) ? EnumMode.Edit : EnumMode.ReadOnly;
            frmFolioDetail.ShowDialog();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Abre la ventana de busqueda
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 12/05/2016
        /// </history>
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            frmFoliosInvitationsOuthousePRDetail frmFolioDetail = new frmFoliosInvitationsOuthousePRDetail();

            frmFolioDetail.Owner     = this;
            frmFolioDetail.personnel = _prFilter;
            frmFolioDetail.enumMode  = EnumMode.Search;
            if (frmFolioDetail.ShowDialog() == true)
            {
                _prFilter = frmFolioDetail.personnel;
                LoadPrs();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Abre la ventana detalle en modo Add
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 07/05/2016
        /// </history>
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            frmFoliosInvitationsOuthousePRDetail frmFolioDetail = new frmFoliosInvitationsOuthousePRDetail();

            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
                }
            }
        }