コード例 #1
0
ファイル: frmLogin.xaml.cs プロジェクト: jackjet870/IM-2
        /// <summary>
        /// Obtiene todos los place y los mantiene en memoria para utilizarlos posteriormente
        /// </summary>
        /// <returns>lista dynamica</returns>
        /// <history>
        /// [erosado] 29/04/2016  Created
        /// </history>
        public async Task <int> getAllPlaces()
        {
            places = new List <Item>();
            switch (_loginType)
            {
            case EnumLoginType.SalesRoom:
                var sr = await BRSalesRooms.GetSalesRoomsByUser();

                sr.ForEach(s => places.Add(new Item()
                {
                    Id = s.srID, Name = s.srN, UserId = s.plpe
                }));
                break;

            case EnumLoginType.Warehouse:
                var wh = await BRWarehouses.GetWarehousesByUser();

                wh.ForEach(w => places.Add(new Item()
                {
                    Id = w.whID, Name = w.whN, UserId = w.plpe
                }));
                break;

            case EnumLoginType.Location:
                var lo = await BRLocations.GetLocationsByUser(programs : EnumToListHelper.GetEnumDescription(_program));

                lo.ForEach(l => places.Add(new Item()
                {
                    Id = l.loID, Name = l.loN, UserId = l.plpe
                }));
                break;
            }
            return(1);
        }
コード例 #2
0
        /// <summary>
        /// Asigna Locations
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 09/07/2016
        /// </history>
        private async void btnAssignLocations_Click(object sender, RoutedEventArgs e)
        {
            string strMsj = "";

            if (dgrRegions.SelectedItems.Count < 1)
            {
                strMsj += "Specify at least one Region. \n";
            }
            if (dgrPrograms.SelectedItems.Count < 1)
            {
                strMsj += "Specify at least one Program.";
            }

            if (strMsj == "")
            {
                string programs  = string.Join(",", dgrPrograms.SelectedItems.OfType <Program>().Select(pg => pg.pgID).ToList());
                string regions   = string.Join(",", dgrRegions.SelectedItems.OfType <Region>().Select(rg => rg.rgID).ToList());
                var    lstAsiggn = await BRLocations.GetLocationsByRegionProgram(programs, 1, regions);

                List <Location> lstLocations = lstAsiggn.Select(lcs => new Location {
                    loA = true, loID = lcs.loID, loN = lcs.loN
                }).ToList();
                dgrLocations.ItemsSource = lstLocations;
                dtcLocations.Header      = "Locations (" + lstLocations.Count + ")";
            }
            else
            {
                UIHelper.ShowMessage(strMsj);
            }
        }
コード例 #3
0
        /// <summary>
        /// Carga y configuracion de Locations.
        /// </summary>
        /// <history>
        /// [edgrodriguez] 23/May/2016 Created
        /// </history>
        private async void LoadLocations()
        {
            _locations = await BRLocations.GetLocationsbyProgram("IH");

            _locations.Insert(0, new Location {
                loID = "ALL", loN = "ALL"
            });
            cbLocation.ItemsSource   = _locations;
            cbLocation.SelectedIndex = 0;
        }
コード例 #4
0
        /// <summary>
        ///   Carga las locaciones
        /// </summary>
        /// <history>
        ///   [vku] 12/Jul/2016 Created
        /// </history>
        public async void LoadLocations()
        {
            try
            {
                List <Location> lstLocations = await BRLocations.GetLocations(nStatus : 1);

                cbotglo.ItemsSource = lstLocations;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #5
0
ファイル: frmGoals.xaml.cs プロジェクト: jackjet870/IM-2
        /// <summary>
        /// Llena el combobox de Locations
        /// </summary>
        /// <history>
        /// [emoguel] created 10/05/2016
        /// </history>
        private async void LoadLocations()
        {
            try
            {
                List <Location> lstLocations = await BRLocations.GetLocations(1);

                cmbLoc.ItemsSource = lstLocations;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #6
0
        /// <summary>
        ///   Llena el combobox de locations relacionados a TeamsGuestServices cuando se abre desde teamPRs
        /// </summary>
        /// <history>
        ///   [vku] 18/Jul/2016 Created
        /// </history>
        protected async void loadLocations()
        {
            try
            {
                List <object> lstLocations = await BRLocations.GetLocationByTeamGuestService();

                cmbLocation.ItemsSource       = lstLocations;
                cmbLocation.SelectedValuePath = "loID";
                cmbLocation.DisplayMemberPath = "loN";
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #7
0
        /// <summary>
        /// Carga los locations
        /// </summary>
        /// <history>
        /// [emoguel] created 16/05/2016
        /// </history>
        private async void LoadLocations()
        {
            try
            {
                List <Location> lstAllLocations = await BRLocations.GetLocations();

                cmbLocations.ItemsSource = lstAllLocations;
                List <Location> lstLocations = lstAllLocations.Where(lo => lo.lols == leadSource.lsID).ToList();
                dgrLocations.ItemsSource = lstLocations;
                _oldLocations            = lstLocations.ToList();
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #8
0
        /// <summary>
        /// Carga los combobox de Places dependiendo el valor seleccionado
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <history>
        /// [emoguel] created 27/04/2016
        /// [emoguel] created 30/05/2016 se volvió async
        /// </history>
        private async void cmbtlTeamType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                switch (teamLog.tlTeamType)
                {
                case "":
                {
                    cmbtlTeam.ItemsSource    = null;
                    cmbtlPlaceID.ItemsSource = null;
                    cmbtlPlaceID.Tag         = "Location";
                    break;
                }

                case "SA":
                {
                    cmbtlPlaceID.Tag = "Sales Room";
                    lblSr.Content    = "Sales Room";
                    cmbtlPlaceID.DisplayMemberPath = "srN";
                    cmbtlPlaceID.SelectedValuePath = "srID";
                    List <SalesRoom> lstSalesRoom = await BRSalesRooms.GetSalesRooms(1, blnTeamLog : true);

                    cmbtlPlaceID.ItemsSource = lstSalesRoom;
                    break;
                }

                case "GS":
                {
                    cmbtlPlaceID.Tag = "Location";
                    lblSr.Content    = "Location";
                    cmbtlPlaceID.DisplayMemberPath = "loN";
                    cmbtlPlaceID.SelectedValuePath = "loID";
                    List <Model.Location> lstLocations = await BRLocations.GetLocations(1, blnTeamsLog : true);

                    cmbtlPlaceID.ItemsSource = lstLocations;
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #9
0
        /// <summary>
        /// Carga el grid y el combo de locations
        /// </summary>
        /// <history>
        /// [emoguel] created 17/05/2016
        /// </history>
        private async void loadLocations()
        {
            try
            {
                List <Location> lstAllLocations = await BRLocations.GetLocations();

                List <Location> lstLocations = (!string.IsNullOrWhiteSpace(locationCategory.lcID)) ? lstAllLocations.Where(lo => lo.lolc == locationCategory.lcID).ToList() : new List <Location>();
                dgrLocation.ItemsSource  = lstLocations;
                cmbLocations.ItemsSource = lstAllLocations;
                _oldLocations            = lstLocations.ToList();
                skpStatus.Visibility     = Visibility.Collapsed;
                btnAccept.Visibility     = Visibility.Visible;
                cmbLocations.Header      = "Location (" + lstLocations.Count + ")";
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #10
0
        /// <summary>
        ///   Carga las locaciones relacionados a TeamGuestServices
        /// </summary>
        /// <history>
        ///   [vku] 19/Jul/2016 Created
        /// </history>
        protected async void LoadLocations()
        {
            try
            {
                List <object> lstLocationsFrom = await BRLocations.GetLocationByTeamGuestService();

                cboPlaceIDFrom.ItemsSource       = lstLocationsFrom;
                cboPlaceIDFrom.SelectedValuePath = "loID";
                cboPlaceIDFrom.DisplayMemberPath = "loN";

                List <object> lstLocationsTo = new List <object>();
                lstLocationsTo.AddRange(lstLocationsFrom);
                cboPlaceIDTo.ItemsSource       = lstLocationsTo;
                cboPlaceIDTo.SelectedValuePath = "loID";
                cboPlaceIDTo.DisplayMemberPath = "loN";
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #11
0
ファイル: frmLocations.xaml.cs プロジェクト: jackjet870/IM-2
        /// <summary>
        /// Llena el grid de locations
        /// </summary>
        /// <history>
        /// [emoguel] created 01/04/2016
        /// </history>
        private async void LoadLocations(Location location = null)
        {
            try
            {
                status.Visibility = Visibility.Visible;
                int             nIndex       = 0;
                List <Location> lstLocations = await BRLocations.GetLocations(_nStatus, _locationFilter);

                dgrLanguages.ItemsSource = lstLocations;
                if (location != null && lstLocations.Count > 0)
                {
                    location = lstLocations.Where(lo => lo.loID == location.loID).FirstOrDefault();
                    nIndex   = lstLocations.IndexOf(location);
                }
                GridHelper.SelectRow(dgrLanguages, nIndex);
                StatusBarReg.Content = lstLocations.Count + " Locations.";
                status.Visibility    = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #12
0
        /// <summary>
        /// Llena el combobox de locations
        /// </summary>
        /// <history>
        /// [emoguel] created 08/07/2016
        /// </history>
        private async void LoadLocations()
        {
            try
            {
                collectionLocations        = (CollectionViewSource)FindResource("cvsLocations");
                collectionLocations.Source = await BRLocations.GetLocations(1);

                List <Location> lstLocations = new List <Location>();
                if (enumMode != EnumMode.Add)
                {
                    var locationByUser = await BRLocations.GetLocationsByGift(gift.giID);

                    lstLocations     = locationByUser.ToList();
                    _lstOldLocations = locationByUser.ToList();
                }
                dgrLocations.ItemsSource = lstLocations;
                dtcLocations.Header      = "Locations (" + lstLocations.Count + ")";
                GridHelper.SelectRow(dgrLocations, 0);
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
コード例 #13
0
        /// <summary>
        /// Carga las locaciones del usuario logeado (Todas)
        /// </summary>
        /// <param name="user"></param>
        private async Task LoadLocations(UserData user)
        {
            var result = await BRLocations.GetLocationsByUser(user.User.peID);

            Locations = result;
        }