private void ProcessRegParking(ParkingSlot parkSlot)
 {
     if (parkSlot.ParkStatus == ParkingStatus.Free || parkSlot.ParkStatus == ParkingStatus.AdvParked)
     {
         parkSlot.ParkedBy = System.Convert.ToInt32(UserID);
         parkSlot.ParkStatus = ParkingStatus.Parked;
         parkSlot.ParkByMe();
     }
     else
     {
         parkSlot.ParkedBy = -1;
         parkSlot.ParkStatus = ParkingStatus.Free;
     }
     AllocateParkingSlots(false, parkSlot.Name, parkSlot.ParkStatus);
 }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/SmartParking;component/MainPage.xaml", System.UriKind.Relative));
     this.stlTxtNormal = ((System.Windows.Style)(this.FindName("stlTxtNormal")));
     this.stlTxtTitle = ((System.Windows.Style)(this.FindName("stlTxtTitle")));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.TitlePanel = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
     this.BtnRefresh = ((System.Windows.Controls.Button)(this.FindName("BtnRefresh")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.R0C0 = ((SmartParking.ParkingSlot)(this.FindName("R0C0")));
     this.R0C1 = ((SmartParking.ParkingSlot)(this.FindName("R0C1")));
     this.C0R0 = ((SmartParking.ParkingSlot)(this.FindName("C0R0")));
     this.C0R1 = ((SmartParking.ParkingSlot)(this.FindName("C0R1")));
     this.C0R2 = ((SmartParking.ParkingSlot)(this.FindName("C0R2")));
     this.C0R3 = ((SmartParking.ParkingSlot)(this.FindName("C0R3")));
     this.C0R4 = ((SmartParking.ParkingSlot)(this.FindName("C0R4")));
     this.C0R5 = ((SmartParking.ParkingSlot)(this.FindName("C0R5")));
     this.C1R0 = ((SmartParking.ParkingSlot)(this.FindName("C1R0")));
     this.C1R1 = ((SmartParking.ParkingSlot)(this.FindName("C1R1")));
     this.C1R2 = ((SmartParking.ParkingSlot)(this.FindName("C1R2")));
     this.C1R3 = ((SmartParking.ParkingSlot)(this.FindName("C1R3")));
     this.C1R4 = ((SmartParking.ParkingSlot)(this.FindName("C1R4")));
     this.C1R5 = ((SmartParking.ParkingSlot)(this.FindName("C1R5")));
     this.btnParked = ((System.Windows.Controls.Button)(this.FindName("btnParked")));
     this.btnUbParked = ((System.Windows.Controls.Button)(this.FindName("btnUbParked")));
 }
 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;
             }
         }
     }
 }