Exemplo n.º 1
0
 public MasterDetailHomePage(ParkedVehiclesFilter lstFilters)
 {
     InitializeComponent();
     dal_Exceptionlog = new DALExceptionManagment();
     LoadLoginUserLocationLots();
     try
     {
         if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken"))
         {
             LoadParkedVehicle(lstFilters);
         }
     }
     catch (Exception ex)
     {
         dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "MonthlyPassCashPaymentPage.xaml.cs", "", "MasterDetailHomePage");
     }
     try
     {
         CheckNFCSupported();
     }
     catch (Exception ex)
     {
         dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "MonthlyPassCashPaymentPage.xaml.cs", "", "CheckNFCSupported");
         DisplayAlert("Alert", "Unable to proceed,Please contact Admin" + ex.Message, "Ok");
     }
 }
 public FiltersPage()
 {
     InitializeComponent();
     dal_Exceptionlog    = new DALExceptionManagment();
     objFilter           = new ParkedVehiclesFilter();
     objSelectedAppTypes = new List <ApplicationType>();
     objSelectedStatus   = new List <Status>();
     dal_Home            = new DALHome();
     GetAllApplicationTypes();
     GetAllStatus();
     GetAllVehicleType();
 }
Exemplo n.º 3
0
        public VMLocationLotParkedVehicles GetAllParkedVehicles(string accessToken, ParkedVehiclesFilter objparkedVehicles)
        {
            VMLocationLotParkedVehicles objVMLocationLotParkedVehicles = new VMLocationLotParkedVehicles();

            try
            {
                string baseUrl = Convert.ToString(App.Current.Properties["BaseURL"]);
                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(baseUrl);
                    client.DefaultRequestHeaders.Accept.Clear();
                    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    // Add the Authorization header with the AccessToken.
                    client.DefaultRequestHeaders.Add("Authorization", "bearer  " + accessToken);
                    // create the URL string.
                    string url = "api/InstaOperator/postOPAPPAllParkedVehicleDetails";
                    // make the request

                    var json    = JsonConvert.SerializeObject(objparkedVehicles);
                    var content = new StringContent(json, Encoding.UTF8, "application/json");
                    HttpResponseMessage response = client.PostAsync(url, content).Result;
                    if (response.IsSuccessStatusCode)
                    {
                        string jsonString = response.Content.ReadAsStringAsync().Result;
                        if (jsonString != null)
                        {
                            APIResponse apiResult = JsonConvert.DeserializeObject <APIResponse>(jsonString);
                            if (apiResult.Result)
                            {
                                var resultobj = JsonConvert.DeserializeObject <VMLocationLotParkedVehicles>(Convert.ToString(apiResult.Object));
                                objVMLocationLotParkedVehicles.CustomerParkingSlotID = resultobj.CustomerParkingSlotID;
                                objVMLocationLotParkedVehicles.TotalTwoWheeler       = resultobj.TotalTwoWheeler;
                                objVMLocationLotParkedVehicles.TotalFourWheeler      = resultobj.TotalFourWheeler;
                                objVMLocationLotParkedVehicles.TotalOutTwoWheeler    = resultobj.TotalOutTwoWheeler;
                                objVMLocationLotParkedVehicles.TotalOutFourWheeler   = resultobj.TotalOutFourWheeler;
                                objVMLocationLotParkedVehicles.TotalHVWheeler        = resultobj.TotalHVWheeler;
                                objVMLocationLotParkedVehicles.TotalOutHVWheeler     = resultobj.TotalOutHVWheeler;
                                objVMLocationLotParkedVehicles.TotalThreeWheeler     = resultobj.TotalThreeWheeler;
                                objVMLocationLotParkedVehicles.TotalOutThreeWheeler  = resultobj.TotalOutThreeWheeler;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(objVMLocationLotParkedVehicles);
        }
Exemplo n.º 4
0
        public void LoadParkedVehicle(ParkedVehiclesFilter objinput)
        {
            try
            {
                LstVWParkingVehicle.ItemsSource = null;
                if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken"))
                {
                    DALHome dal_Home = new DALHome();

                    if (objinput == null)
                    {
                        User objLoginUser = (User)App.Current.Properties["LoginUser"];
                        objinput = new ParkedVehiclesFilter();
                        VMLocationLots objVMLocations = (VMLocationLots)pickerLocationLot.SelectedItem;
                        objinput.LocationID           = objLoginUser.LocationParkingLotID.LocationID.LocationID;
                        objinput.LocationParkingLotID = objLoginUser.LocationParkingLotID.LocationParkingLotID;
                        if (objLoginUser.LocationParkingLotID.LocationParkingLotID == null || objLoginUser.LocationParkingLotID.LocationParkingLotID == 0)
                        {
                            if (objVMLocations != null)
                            {
                                objinput.LocationParkingLotID = objVMLocations.LocationParkingLotID;
                            }
                        }
                    }
                    VMLocationLotParkedVehicles vmVehicles = null;

                    if (DeviceInternet.InternetConnected())
                    {
                        vmVehicles = dal_Home.GetAllParkedVehicles(Convert.ToString(App.Current.Properties["apitoken"]), objinput);
                    }
                    else
                    {
                        vmVehicles = dal_Home.GetAllParkedVehiclesOffline();
                    }

                    lstdayvehicles = vmVehicles.CustomerParkingSlotID;
                    LstVWParkingVehicle.ItemsSource = vmVehicles.CustomerParkingSlotID;
                    labelTotalTwoWheeler.Text       = Convert.ToString(vmVehicles.TotalTwoWheeler) + "(" + Convert.ToString(vmVehicles.TotalOutTwoWheeler) + ")";
                    labelTotalFourWheeler.Text      = Convert.ToString(vmVehicles.TotalFourWheeler) + "(" + Convert.ToString(vmVehicles.TotalOutFourWheeler) + ")";
                    labelTotalHVWheeler.Text        = Convert.ToString(vmVehicles.TotalHVWheeler) + "(" + Convert.ToString(vmVehicles.TotalOutHVWheeler) + ")";
                    labelTotalThreeWheeler.Text     = Convert.ToString(vmVehicles.TotalThreeWheeler) + "(" + Convert.ToString(vmVehicles.TotalOutThreeWheeler) + ")";
                }
            }
            catch (Exception ex)
            {
                dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "MasterDetailHomePage.xaml.cs", "", "LoadParkedVehicle");
            }
        }
Exemplo n.º 5
0
        private async void PickerLocationLot_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken"))
                {
                    if (pickerLocationLot.SelectedItem != null)
                    {
                        User           objLoginUser   = (User)App.Current.Properties["LoginUser"];
                        VMLocationLots objVMLocations = (VMLocationLots)pickerLocationLot.SelectedItem;
                        if (objVMLocations != null)
                        {
                            string lotName = objVMLocations.LocationParkingLotName;
                            ParkedVehiclesFilter objloclot = new ParkedVehiclesFilter();
                            objloclot.LocationParkingLotID = objVMLocations.LocationParkingLotID;
                            objloclot.LocationID           = objVMLocations.LocationID;
                            objLoginUser.LocationParkingLotID.LocationParkingLotID       = objVMLocations.LocationParkingLotID;
                            objLoginUser.LocationParkingLotID.LocationParkingLotName     = objVMLocations.LotName;
                            objLoginUser.LocationParkingLotID.LocationID.LocationID      = objVMLocations.LocationID;
                            objLoginUser.LocationParkingLotID.LocationID.LocationName    = objVMLocations.LocationName;
                            objLoginUser.LocationParkingLotID.LotOpenTime                = objVMLocations.LotOpenTime;
                            objLoginUser.LocationParkingLotID.LotCloseTime               = objVMLocations.LotCloseTime;
                            objLoginUser.LocationParkingLotID.LotVehicleAvailabilityName = objVMLocations.LotVehicleAvailabilityName;

                            IsTodayHoliday    = objVMLocations.IsActive;
                            todayLotOpenTime  = objVMLocations.LotOpenTime;
                            todayLotCloseTime = objVMLocations.LotCloseTime;
                            LoadParkedVehicle(objloclot);
                            if (DeviceInternet.InternetConnected())
                            {
                                await App.SQLiteDb.SaveVehiclesParkingFeesDetailOnLogin(Convert.ToString(App.Current.Properties["apitoken"]), objVMLocations.LocationParkingLotID);

                                await App.SQLiteDb.SaveAllVehicleTypesInSQLLite(Convert.ToString(App.Current.Properties["apitoken"]), objVMLocations.LocationID);
                            }
                        }
                    }
                }
                else
                {
                    await DisplayAlert("Alert", "Token details  unavailable", "Ok");
                }
            }
            catch (Exception ex)
            {
                dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "MasterDetailHomePage.xaml.cs", "", "LoadLoginUserLocationLots");
            }
        }
Exemplo n.º 6
0
 public MasterHomePage(ParkedVehiclesFilter selectedFilters)
 {
     InitializeComponent();
     dal_Menubar = new DALMenubar();
     try
     {
         if (App.Current.Properties.ContainsKey("LoginUser"))
         {
             User loginUser = (User)App.Current.Properties["LoginUser"];
             labelUserName.Text = loginUser.UserName;
             labelUserID.Text   = "ID: " + Convert.ToString(loginUser.UserCode);
             MasterDetailHomePage homefilterPage = new MasterDetailHomePage(selectedFilters);
             Detail      = new NavigationPage(homefilterPage);
             IsPresented = false;
         }
     }
     catch (Exception ex)
     {
     }
 }