Beispiel #1
0
        /// <summary>
        /// Muestra la ventana detalle en modo ReadOnly|edicion
        /// </summary>
        /// <history>
        /// [emoguel] 01/04/2016
        /// </history>
        private void Cell_DoubleClick(object sender, RoutedEventArgs e)
        {
            Location          location          = (Location)dgrLanguages.SelectedItem;
            frmLocationDetail frmLocationDetail = new frmLocationDetail();

            frmLocationDetail.Owner       = this;
            frmLocationDetail.oldLocation = location;
            frmLocationDetail.enumMode    = ((_blnEdit)?EnumMode.Edit:EnumMode.ReadOnly);
            if (frmLocationDetail.ShowDialog() == true)
            {
                int             nIndex       = dgrLanguages.SelectedIndex;
                List <Location> lstLocations = (List <Location>)dgrLanguages.ItemsSource;
                if (!ValidateFilter(frmLocationDetail.location))
                {
                    lstLocations.Remove(location);
                }
                else
                {
                    ObjectHelper.CopyProperties(location, frmLocationDetail.location);
                    lstLocations.Sort((x, y) => string.Compare(x.loN, y.loN));
                    nIndex = lstLocations.IndexOf(location);
                }
                dgrLanguages.Items.Refresh();
                GridHelper.SelectRow(dgrLanguages, nIndex);
                StatusBarReg.Content = lstLocations.Count + " Locations.";
            }
        }
Beispiel #2
0
        /// <summary>
        /// Abre la venatana detalle en modo busqueda
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 01/04/2016
        /// </history>
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            frmLocationDetail frmLocationDetail = new frmLocationDetail();

            frmLocationDetail.Owner       = this;
            frmLocationDetail.enumMode    = EnumMode.Search;
            frmLocationDetail.oldLocation = _locationFilter;
            frmLocationDetail.nStatus     = _nStatus;
            if (frmLocationDetail.ShowDialog() == true)
            {
                _locationFilter = frmLocationDetail.location;
                _nStatus        = frmLocationDetail.nStatus;
                LoadLocations();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Abre la ventana detalle en modo add
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 01/04/2016
        /// </history>
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            frmLocationDetail frmLocationDetail = new frmLocationDetail();

            frmLocationDetail.Owner    = this;
            frmLocationDetail.enumMode = EnumMode.Add;
            if (frmLocationDetail.ShowDialog() == true)
            {
                Location location = frmLocationDetail.location;
                if (ValidateFilter(location))//Validar si cumple con los filtros actuales
                {
                    List <Location> lstLocations = (List <Location>)dgrLanguages.ItemsSource;
                    lstLocations.Add(location);                                //Agregamos el nuevo registro al grid
                    lstLocations.Sort((x, y) => string.Compare(x.loN, y.loN)); //ordenamos la lista
                    int nIndex = lstLocations.IndexOf(location);               //Obtenemos el indez del nuevo registro
                    dgrLanguages.Items.Refresh();                              //Actualizamos la vista del grid
                    StatusBarReg.Content = lstLocations.Count + "Locations.";  //Actualizamos el contador
                }
            }
        }