private void GoForOTP()
 {
     WebAPICaller myWebAPICaller = new WebAPICaller();
     myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(string));
     myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOn_GetOTP);
     myWebAPICaller.GET("UserProfile/GetOTP?MobileNo=" + txtMobileNo.Text.Trim());
 }
 private void LoadWalletTrans()
 {
     WebAPICaller myWebAPICaller = new WebAPICaller();
     myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(WalletTransModel[]));
     myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOnReadCompleted);
     myWebAPICaller.GET("WalletTrans/GetWalletTrans?userID=" + ParkingBase.UserID);
 }
 private void LoadParkingList()
 {
     WebAPICaller myWebAPICaller = new WebAPICaller();
     myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(SelectedListModel[]));
     myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOnReadCompleted);
     myWebAPICaller.GET("parkingmaster/GetParkings/");
 }
 public void LoadParkingSlots()
 {
     WebAPICaller myWebAPICaller = new WebAPICaller();
     myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(SlotModel[]));
     myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOn_LoadParkingSlots);
     string selParking = IsolatedStorageSettings.ApplicationSettings[_SelParking].ToString();
     myWebAPICaller.GET("SlotMaster/GetSlots" , "id=" + selParking);
 }
 private void SelectParkingAuto(string Latitude, string Longitude)
 {
     Latitude = "2"; Longitude = "5";
     WebAPICaller myWebAPICaller = new WebAPICaller();
     myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(SelectedListModel[]));
     myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOnReadCompleted_AutoSel);
     myWebAPICaller.GET("parkingmaster/GetSearchParkingMaster/", "Latitude=" + Latitude + "&Longitude=" + Longitude);
     //http://localhost:62073/api/parkingmaster/GetSearchParkingMaster?Latitude=1&Longitude=1
 }
        void ActionOnReadCompleted(object myList)
        {
            if (myList == null) return;
            WalletTransModel[] EntityList;
            EntityList = (WalletTransModel[])myList;
            //List<WalletTransModel> lst = new List<WalletTransModel>(myList);

            IList<WalletTransModel> lstSrc = EntityList;

            lstWalletTrans.ItemsSource = lstSrc;// new CollectionViewSource { Source = (CollectionViewSource)lstSrc };

            WebAPICaller myWebAPICaller = new WebAPICaller();
            myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOnReadCompleted_Amount);
            myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(int));
            myWebAPICaller.GET("UserProfile/GetWalletAmount?userID=" + ParkingBase.UserID);
        }
 private void LoadUserProfile()
 {
     if (ParkingBase.UserID  != null)
     {
         WebAPICaller myWebAPICaller = new WebAPICaller();
         myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(UserProfileModel));
         myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOn_LoadUserProfile);
         myWebAPICaller.GET("UserProfile/GetUserProfile/" + ParkingBase.UserID);
     }
     else
     {
         txtUserName.Text = "";
         txtAddress.Text = "";
         txtMobileNo.Text = "";
         txtVehclNo.Text = "";
         txtCity.Text = "";
         txtPincode.Text = "";
         txtEmailID.Text = "";
         return;
     }
 }
 void Save()
 {
     if (!IsValidInput())
     {
         MessageBox.Show("User Name is mandatory.");
         return;
     }
     WebAPICaller myWebAPICaller = new WebAPICaller();
     UserProfileModel model = new UserProfileModel();
     model.FirstName = txtUserName.Text;
     model.Address1 = txtAddress.Text;
     model.MobileNumber = txtMobileNo.Text;
     model.ActiveVehicleNumber = txtVehclNo.Text;
     model.City=txtCity.Text ;
     model.Pincode=txtPincode.Text ;
     model.EmailID=txtEmailID.Text ;
     if (ParkingBase.UserID != null)
     {
         model.UserID = System.Convert.ToInt32(ParkingBase.UserID);
         myWebAPICaller.POST("UserProfile/PostUpdateUserProfile/", model);
     }
     else
     {
         myWebAPICaller.ActionOnUploadCompleted = new DlgtActionOnUploadCompleted(ActionOn_SaveUserProfile);
         myWebAPICaller.POST("UserProfile/PostUserProfile/", model);
     }
     NavigationService.GoBack();
 }
 private void LoadUserProfile()
 {
     string UserId;
     if (IsolatedStorageSettings.ApplicationSettings.Contains(_UserID ))
     {
         UserId = IsolatedStorageSettings.ApplicationSettings[_UserID].ToString();
         WebAPICaller myWebAPICaller = new WebAPICaller();
         myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(UserProfileModel));
         myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOn_LoadUserProfile);
         myWebAPICaller.GET("UserProfile/GetUserProfile/" + UserId);
     }
     else
     {
         txtUserName.Text = "";
         txtAddress.Text = "";
         txtMobileNo.Text = "";
         txtVehclNo.Text = "";
         txtCity.Text = "";
         txtPincode.Text = "";
         txtEmailID.Text = "";
         return;
     }
 }
 void Save()
 {
     if (!IsValidInput())
     {
         MessageBox.Show("User Name is mandatory.");
         return;
     }
     string UserId;
     WebAPICaller myWebAPICaller = new WebAPICaller();
     UserProfileModel model = new UserProfileModel();
     model.FirstName = txtUserName.Text;
     model.Address1 = txtAddress.Text;
     model.MobileNumber = txtMobileNo.Text;
     model.ActiveVehicleNumber = txtVehclNo.Text;
     model.City=txtCity.Text ;
     model.Pincode=txtPincode.Text ;
     model.EmailID=txtEmailID.Text ;
     if (IsolatedStorageSettings.ApplicationSettings.Contains(_UserID))
     {
         UserId = IsolatedStorageSettings.ApplicationSettings[_UserID].ToString();
         model.UserID = System .Convert.ToInt32(UserId);
         myWebAPICaller.POST("UserProfile/PostUpdateUserProfile/", model);
     }
     else
     {
         myWebAPICaller.ActionOnUploadCompleted = new DlgtActionOnUploadCompleted(ActionOn_SaveUserProfile);
         myWebAPICaller.POST("UserProfile/PostUserProfile/", model);
     }
     NavigationService.GoBack();
 }
 private void LoadParkingSlots()
 {
     WebAPICaller myWebAPICaller = new WebAPICaller();
     myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(string[]));
     myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOn_LoadParkingSlots);
     myWebAPICaller.GET("ParkingSlot");
 }
 private void AllocateParkingSlots(string barcodeNo, bool  isAlloc )
 {
     WebAPICaller myWebAPICaller = new WebAPICaller();
     string jsonData = "{'BarcodeNo':'" + barcodeNo + "','IsOccupied':'" + isAlloc.ToString() + "'}";
     myWebAPICaller.POST("ParkingSlot", jsonData );
 }
 private void AllocateParkingSlots(bool isCalledFromBarcodeScanner, string barcodeNo, bool isAlloc)
 {
     WebAPICaller myWebAPICaller = new WebAPICaller();
     string selParking = IsolatedStorageSettings.ApplicationSettings[_SelParking].ToString();
     if (!IsolatedStorageSettings.ApplicationSettings.Contains(_UserID))
         IsolatedStorageSettings.ApplicationSettings[_UserID] = 12;
     string userId = IsolatedStorageSettings.ApplicationSettings[_UserID].ToString();
     string urlParam = "userId=" + userId + "&parkingId=" + selParking + "&slotNo=" + barcodeNo + "&isAcquired=" + isAlloc.ToString();
     myWebAPICaller.POST_urlParam("SlotMaster/PostParkUnPark",  urlParam );
     if (isCalledFromBarcodeScanner)
     {
         object slot = _SlotContainer.FindName(barcodeNo);
         if (slot == null) return;
         ((ParkingSlot)slot).Parked = isAlloc;
     }
 }
 private void ProcessAdvParking(ParkingSlot parkSlot)
 {
     if (parkSlot.ParkStatus == ParkingStatus.Parked)
     {
         MessageBox.Show("Parked Slots are not allowed for Advance Parking");
         return;
     }
     else
     {
         if (MessageBox.Show("Are you Confirmed", "Confirmation", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
             return;
         else
         {
             if (parkSlot.ParkStatus == ParkingStatus.AdvParked)
             {
                 parkSlot.ParkStatus = ParkingStatus.Free;
                 AllocateParkingSlots(false, parkSlot.Name, parkSlot.ParkStatus);
             }
             else
             {
                 WebAPICaller myWebAPICaller = new WebAPICaller();
                 myWebAPICaller.ActionOnReadCompleted = new DlgtActionOnReadCompleted(ActionOnReadCompleted_BalAmount);
                 myWebAPICaller.JsonSerializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(int));
                 myWebAPICaller.GET("UserProfile/GetWalletAmount?userID=" + UserID);
                 _MyParkSlot = parkSlot;
             }
         }
     }
 }
 private void AllocateParkingSlots(bool isCalledFromBarcodeScanner, string barcodeNo, ParkingStatus parkStatus)
 {
     WebAPICaller myWebAPICaller = new WebAPICaller();
     string selParking = IsolatedStorageSettings.ApplicationSettings[_SelParking].ToString();
     
     string urlParam = "userId=" + UserID + "&parkingId=" + selParking + "&slotNo=" + barcodeNo + "&SlotStatus=" + ((int)parkStatus).ToString();
     myWebAPICaller.POST_urlParam("SlotMaster/PostParkUnPark",  urlParam );
     if (isCalledFromBarcodeScanner)
     {
         object slot = _SlotContainer.FindName(barcodeNo);
         if (slot == null) return;
         ((ParkingSlot)slot).ParkStatus = parkStatus;
     }
 }