Beispiel #1
0
        /// <summary>
        /// LLena el grid de depts
        /// </summary>
        /// <history>
        /// [emoguel] created 11/06/2016
        /// </history>
        private async void LoadDeps()
        {
            try
            {
                List <Dept> lstDepst = await BRDepts.GetDepts(1);

                lstDepst.Insert(0, new Dept {
                    deID = "ALL", deN = "ALL"
                });
                cmbDepts.ItemsSource   = lstDepst;
                cmbDepts.SelectedValue = dept;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Llena el grid de Depts
        /// </summary>
        /// <param name="dept">Objeto a seleccionar</param>
        /// <history>
        /// [emoguel] created 03/05/2016
        /// [emoguel] modified 09/06/2016--> se volvió async
        /// </history>
        private async void LoadDepts(Dept dept = null)
        {
            try
            {
                status.Visibility = Visibility.Visible;
                int         nIndex   = 0;
                List <Dept> lstDepts = await BRDepts.GetDepts(_nStatus, _deptFilter);

                dgrDepts.ItemsSource = lstDepts;
                if (lstDepts.Count > 0 && dept != null)
                {
                    dept   = lstDepts.Where(de => de.deID == dept.deID).FirstOrDefault();
                    nIndex = lstDepts.IndexOf(dept);
                }
                GridHelper.SelectRow(dgrDepts, nIndex);
                StatusBarReg.Content = lstDepts.Count + " Depts.";
                status.Visibility    = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }