Example #1
0
        /// <summary>
        /// Muestra la ventana detalle en modo edit
        /// </summary>
        /// <history>
        /// [emoguel] 25/04/2016 Created
        /// </history>
        private void Cell_DoubleClick(object sender, RoutedEventArgs e)
        {
            ShowProgram          showProgram          = (ShowProgram)dgrShowPrograms.SelectedItem;
            frmShowProgramDetail frmShowProgramDetail = new frmShowProgramDetail();

            frmShowProgramDetail.Owner          = this;
            frmShowProgramDetail.oldShowProgram = showProgram;
            frmShowProgramDetail.enumMode       = EnumMode.Edit;
            if (frmShowProgramDetail.ShowDialog() == true)
            {
                List <ShowProgram> lstShowPrograms = (List <ShowProgram>)dgrShowPrograms.ItemsSource;
                int nIndex = 0;
                if (ValidateFilter(frmShowProgramDetail.showProgram))                           //Validar que cumpla con los filtros
                {
                    ObjectHelper.CopyProperties(showProgram, frmShowProgramDetail.showProgram); //Actualizar los datos
                    lstShowPrograms.Sort((x, y) => string.Compare(x.skN, y.skN));               //Ordenar la lista
                    nIndex = lstShowPrograms.IndexOf(showProgram);                              //Obtener la posición del registro
                }
                else
                {
                    lstShowPrograms.Remove(showProgram);                          //Remover el registro
                }
                dgrShowPrograms.Items.Refresh();                                  //Actualizar la vista
                GridHelper.SelectRow(dgrShowPrograms, nIndex);                    //Seleccionar el registro
                StatusBarReg.Content = lstShowPrograms.Count + " Show Programs."; //Actualizar el contador
            }
        }
Example #2
0
        /// <summary>
        /// Abre la ventana detalle en modo Search
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 25/04/2016
        /// </history>
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            frmShowProgramDetail frmShowProgramDetail = new frmShowProgramDetail();

            frmShowProgramDetail.Owner          = this;
            frmShowProgramDetail.enumMode       = EnumMode.Search;
            frmShowProgramDetail.oldShowProgram = _showProgramFilter;
            frmShowProgramDetail.nStatus        = _nStatus;
            if (frmShowProgramDetail.ShowDialog() == true)
            {
                _nStatus           = frmShowProgramDetail.nStatus;
                _showProgramFilter = frmShowProgramDetail.showProgram;
                LoadShowPrograms();
            }
        }
Example #3
0
        /// <summary>
        /// Abre la ventana detalle en modo Add
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 26/04/2016
        /// </history>
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            frmShowProgramDetail frmShowProgramDetail = new frmShowProgramDetail();

            frmShowProgramDetail.Owner    = this;
            frmShowProgramDetail.enumMode = EnumMode.Add;
            if (frmShowProgramDetail.ShowDialog() == true)
            {
                ShowProgram showProgram = frmShowProgramDetail.showProgram;
                if (ValidateFilter(showProgram))//Validar si cumple con los filtros
                {
                    List <ShowProgram> lstShowPrograms = (List <ShowProgram>)dgrShowPrograms.ItemsSource;
                    lstShowPrograms.Add(showProgram);                                 //Agregamos el registro
                    lstShowPrograms.Sort((x, y) => string.Compare(x.skN, y.skN));     //Ordenar la lista
                    int nIndex = lstShowPrograms.IndexOf(showProgram);                //Obtener la posición del registro
                    dgrShowPrograms.Items.Refresh();                                  //Actualizar la vista
                    GridHelper.SelectRow(dgrShowPrograms, nIndex);                    //Seleccionar un registro
                    StatusBarReg.Content = lstShowPrograms.Count + " Show Programs."; //Actualizamos el contador
                }
            }
        }