Exemple #1
0
        private void LoadLocationLotActiveOperators(VMLocationLots objVMLocationLot, int UserID)
        {
            try
            {
                if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken"))
                {
                    DALHome dal_Home = new DALHome();
                    User    objselectedlocationlot = new User();

                    objselectedlocationlot.UserID = UserID;
                    objselectedlocationlot.LocationParkingLotID.LocationID.LocationID = objVMLocationLot.LocationID;
                    objselectedlocationlot.LocationParkingLotID.LocationParkingLotID  = objVMLocationLot.LocationParkingLotID;
                    lstOperators = dal_Home.GetLocationLotActiveOperators(Convert.ToString(App.Current.Properties["apitoken"]), objselectedlocationlot);
                    if (lstOperators.Count > 0)
                    {
                        pickerOperator.ItemsSource   = lstOperators;
                        pickerOperator.SelectedIndex = 1;
                    }
                }
            }
            catch (Exception ex)
            {
                dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "ReportPage.xaml.cs", "", "LoadLocationLotActiveOperators");
            }
        }
Exemple #2
0
        private void LoadLocationLotActiveOperators(VMLocationLots objVMLocationLot, int UserID)
        {
            try
            {
                if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken"))
                {
                    DALHome dal_Home = new DALHome();

                    objReportUser.UserID = UserID;
                    objReportUser.LocationParkingLotID.LocationID.LocationID = objVMLocationLot.LocationID;
                    objReportUser.LocationParkingLotID.LocationParkingLotID  = objVMLocationLot.LocationParkingLotID;
                    lstOperators = dal_Home.GetLocationLotActiveOperators(Convert.ToString(App.Current.Properties["apitoken"]), objReportUser);
                    var loginuser = (User)App.Current.Properties["LoginUser"];
                    if ((loginuser.UserTypeID.UserTypeName).ToUpper() == "OPERATOR".ToUpper())
                    {
                        lstOperators.RemoveAll(item => item.UserID != loginuser.UserID);
                    }
                    if (lstOperators.Count > 0)
                    {
                        pickerOperator.ItemsSource   = lstOperators;
                        pickerOperator.SelectedIndex = 1;
                        GetLotOccupancy(objReportUser);
                    }
                }
            }
            catch (Exception ex)
            {
                dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "LotOccupancy.xaml.cs", "", "LoadLocationLotActiveOperators");
            }
        }