示例#1
0
        /// <summary>
        /// Carga los combobox.
        /// </summary>
        /// <param name="blnClub"></param>
        /// <history>
        /// [aalcocer] 24/May/2016 Created
        /// </history>
        private async void LoadCombos(bool blnClub)
        {
            cboSaveCourtesyTours.ItemsSource = EnumToListHelper.GetList <EnumSaveCourtesyTours>();
            cboExternal.ItemsSource          = EnumToListHelper.GetList <EnumExternalInvitation>();

            if (blnClub)
            {
                cboClub.ItemsSource = await BRClubs.GetClubs(nStatus : 1);
            }

            LoadUserFilters();
        }
示例#2
0
        /// <summary>
        /// Llena el combobox de Clubs
        /// </summary>
        /// <history>
        /// [emoguel] created 11/03/2016
        /// </history>
        protected async void LoadClubs()
        {
            try
            {
                List <Club> lstClubs = await BRClubs.GetClubs(new Club());

                cmbagcl.ItemsSource = lstClubs;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
示例#3
0
        /// <summary>
        /// Agrega|Actualiza un registro en los catalogos Banks y Agencies
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 03/05/2016
        /// [emoguel] modified 30/05/2016 se volvió async
        /// </history>
        private async void btnAccept_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                btnAccept.Focus();
                List <Agency> lstAgencies = (List <Agency>)dtgAgencies.ItemsSource;
                if (enumMode != EnumMode.Add && ObjectHelper.IsEquals(club, oldClub) && ObjectHelper.IsListEquals(_oldLstAgencies, lstAgencies))
                {
                    blnClosing = true;
                    Close();
                }
                else
                {
                    skpStatus.Visibility = Visibility.Visible;
                    txtStatus.Text       = "Saving Data...";
                    btnAccept.Visibility = Visibility.Collapsed;
                    string strMsj = ValidateHelper.ValidateForm(this, "Club", blnDatagrids: true);
                    if (club.clID == 0)
                    {
                        strMsj += (strMsj == "") ? "" : " \n " + "The Club ID can not be 0.";
                    }
                    if (strMsj == "")
                    {
                        List <Agency> lstAdd = lstAgencies.Where(ag => !_oldLstAgencies.Any(agg => agg.agID == ag.agID)).ToList();
                        List <Agency> lstDel = _oldLstAgencies.Where(ag => !lstAgencies.Any(agg => agg.agID == ag.agID)).ToList();
                        int           nRes   = await BRClubs.SaveClub(club, (enumMode == EnumMode.Edit), lstAdd, lstDel);

                        UIHelper.ShowMessageResult("Club", nRes);
                        if (nRes > 0)
                        {
                            blnClosing   = true;
                            DialogResult = true;
                            Close();
                        }
                    }
                    else
                    {
                        UIHelper.ShowMessage(strMsj);
                    }
                    skpStatus.Visibility = Visibility.Collapsed;
                    btnAccept.Visibility = Visibility.Visible;
                }
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
        /// <summary>
        /// Carga el grid de clubs
        /// </summary>
        /// <history>
        /// [emoguel] created 07/06/2016
        /// </history>
        private async void LoadClubs()
        {
            try
            {
                List <Club> lstClubs = await BRClubs.GetClubs(null, 1);

                if (enumMode == EnumMode.Search)
                {
                    lstClubs.Insert(0, new Club {
                        clID = 0, clN = "ALL"
                    });
                }
                cmbClub.ItemsSource  = lstClubs;
                skpStatus.Visibility = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
示例#5
0
        /// <summary>
        /// Llena el grid de clubs
        /// </summary>
        /// <param name="club">Objeto a seleccionar</param>
        /// <history>
        /// [emoguel] created 02/05/2016
        /// </history>
        private async void LoadClubs(Club club = null)
        {
            try
            {
                status.Visibility = Visibility.Visible;
                int         nIndex   = 0;
                List <Club> lstClubs = await BRClubs.GetClubs(_clubFilter, _nStatus);

                dtgClubs.ItemsSource = lstClubs;
                if (lstClubs.Count > 0 && club != null)
                {
                    club   = lstClubs.FirstOrDefault(cl => cl.clID == club.clID);
                    nIndex = lstClubs.IndexOf(club);
                }
                GridHelper.SelectRow(dtgClubs, nIndex);
                StatusBarReg.Content = lstClubs.Count + " Clubs.";
                status.Visibility    = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }