예제 #1
0
        void ActionDropItem(object sender, EventArgs e)
        {
            if (!ItemModel.IsValidDrop())
            {
                ShowMessageBox(null, Constants.STR_DROP_INVALID);
                return;
            }

            Location cLocation = GetGPSLocation();

            Location dLocation = new Location("");

            dLocation.Latitude  = ItemModel.Location_Lat;
            dLocation.Longitude = ItemModel.Location_Lnt;

            var distance = dLocation.DistanceTo(cLocation);

            if (distance > Constants.PURCHASE_DISTANCE)
            {
                PurchasePopUp myDiag = PurchasePopUp.newInstance(Constants.PURCHASE_TYPE.DROP, DropPurchase);
                myDiag.Show(FragmentManager, "Diag");
                return;
            }

            CreateDrop(ItemModel.parseItem);
        }
예제 #2
0
 void ActionNoExpiry(object sender, EventArgs e)
 {
     if (!checkExpiryDate.Checked)
     {
         txtExpireDate.Enabled = true;
         txtExpireDate.Text    = "";
         //checkExpiryDate.Checked = false;
     }
     else
     {
         PurchasePopUp myDiag = PurchasePopUp.newInstance(Constants.PURCHASE_TYPE.EXPIRY, ExpiryPurchase);
         myDiag.Show(FragmentManager, "Diag");
     }
 }
예제 #3
0
        public bool OnMarkerClick(Marker marker)
        {
            mSelectedDrop = new ParseItem();
            for (var i = 0; i < dropIDs.Count; i++)
            {
                if (marker.Id == dropIDs[i])
                {
                    mSelectedDrop = mDrops[i];
                }
            }
            if (mSelectedDrop == null)
            {
                return(false);
            }

            if (mSelectedDrop.Password == string.Empty || mSelectedDrop.Password == null)
            {
                var location = GetGPSLocation();

                Location pointB = new Location("");
                pointB.Latitude  = mSelectedDrop.Location_Lat;
                pointB.Longitude = mSelectedDrop.Location_Lnt;
                var distanceToB = pointB.DistanceTo(location);

                if (distanceToB > Constants.PURCHASE_DISTANCE)
                {
                    PurchasePopUp myDiag = PurchasePopUp.newInstance(Constants.PURCHASE_TYPE.VIEW, OpenPurchase);
                    myDiag.Show(FragmentManager, "Diag");
                }
                else
                {
                    ViewDropDetail();
                }
            }
            else
            {
                //MyInputDialog myDiag = MyInputDialog.newInstance(Constants.STR_VERIFY_PASSWORD_TITLE, VerifyPassword);
                InputPopUp myDiag = InputPopUp.newInstance("Password?", VerifyPassword);
                myDiag.Show(FragmentManager, "Diag");
            }
            return(true);
        }