Exemple #1
0
        void pin_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            Image pin = sender as Image;

            if (pin.DataContext is AcquirerModel)
            {
                AcquirerModel  acquirer = pin.DataContext as AcquirerModel;
                Recycle_Menu_1 menu     = new Recycle_Menu_1();
                menu.tbl_BinName.Text  = acquirer.BinName;
                menu.tbk_UserName.Text = acquirer.AcquirerName;
                menu.tbk_Phone.Text    = acquirer.Phone;
                menu.tbk_Address.Text  = acquirer.Address;
                menu.Tag    = acquirer.Id;
                menu.Width  = 300;
                menu.Height = 250;
                layer.AddChild(menu, new GeoCoordinate(acquirer.Latitude, acquirer.Longitude));
            }
            else
            {
                RewardModel   reward = pin.DataContext as RewardModel;
                Reward_Menu_1 menu   = new Reward_Menu_1();
                menu.tbk_UserName.Text = reward.StoreName;
                menu.tbk_Phone.Text    = reward.Phone;
                menu.tbk_Address.Text  = reward.Address;
                menu.tbk_Describe.Text = reward.Describe;
                menu.image_Item.Source = new BitmapImage(new Uri(reward.AvatarUri, UriKind.Relative));
                menu.Width             = 350;
                menu.Height            = 250;
                layer.AddChild(menu, new GeoCoordinate(reward.Latitude, reward.Longitude));
            }
        }
Exemple #2
0
        private void Recycle_Menu_detail_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            if (e.OriginalSource is Image)
            {
                page.Storyboard2.Begin();
                Image         image    = e.OriginalSource as Image;
                AcquirerModel acquirer = image.DataContext as AcquirerModel;
                if (image.Name == "btn_SeeInMap")
                {
                    //AcquirerModel model = image.DataContext as AcquirerModel;
                    //Image pin = new Image() { Source = new BitmapImage(new Uri("/Image_Recycle/bubble.png", UriKind.Relative)) };
                    //pin.Width = 40;
                    //pin.Height = 40;
                    //pin.Tag = model.Id;
                    //pin.DataContext = model;
                    //page.layer.AddChild(pin, new GeoCoordinate(model.Latitude, model.Longitude));
                    page.rb_Recycle.IsChecked = true;

                    Recycle_Menu_1 menu = new Recycle_Menu_1();
                    menu.tbl_BinName.Text  = acquirer.BinName;
                    menu.tbk_UserName.Text = acquirer.AcquirerName;
                    menu.tbk_Phone.Text    = acquirer.Phone;
                    menu.tbk_Address.Text  = acquirer.Address;
                    menu.Tag    = acquirer.Id;
                    menu.Width  = 300;
                    menu.Height = 250;
                    page.layer.AddChild(menu, new GeoCoordinate(acquirer.Latitude, acquirer.Longitude));
                    page.map.SetView(new GeoCoordinate(acquirer.Latitude, acquirer.Longitude), 16);
                    this.Visibility = Visibility.Collapsed;
                }
                else
                {
                    Recycle_Menu_SendMessage control_SendMessage = new Recycle_Menu_SendMessage();
                    control_SendMessage.Tag           = acquirer.Id;
                    control_SendMessage.tbk_Name.Text = acquirer.AcquirerName;
                    control_SendMessage.Width         = 350;
                    control_SendMessage.Height        = 330;
                    control_SendMessage.Visibility    = Visibility.Visible;
                    page.LayoutRoot.Children.Add(control_SendMessage);
                    this.Visibility = Visibility.Collapsed;
                }
            }
        }
Exemple #3
0
        List <AcquirerModel> getAcquirerList()
        {
            List <AcquirerModel> List_Acquirers = new List <AcquirerModel>();

            // List<AcquirerTable> list_Acquirer = db.Acquirers.Where(c => Math.Abs(c.Latitude - user.Latitude) < 1 && Math.Abs(c.Longitude - user.Longitude) < 1).ToList<AcquirerTable>();
            foreach (AcquirerTable acquirer in db.Acquirers)
            {
                AcquirerModel model = new AcquirerModel()
                {
                    BinName      = acquirer.BinName,
                    AcquirerName = acquirer.UserName,
                    Address      = acquirer.Address,
                    Phone        = acquirer.Phone,
                    Latitude     = (double)acquirer.Latitude,
                    Longitude    = (double)acquirer.Longitude,
                    Id           = acquirer.Id
                };
                List_Acquirers.Add(model);
            }
            return(List_Acquirers);
        }