public ActionResult DeleteConfirmed(int id) { PassPrice passPrice = db.PassPrices.Find(id); db.PassPrices.Remove(passPrice); db.SaveChanges(); return(RedirectToAction("Index")); }
public MultiStationPassPage(string NewOrReNew, PassPrice objmultiVMPass) { InitializeComponent(); labelSelectedStations.Text = "You have selected MULTI STATION monthly pass.You can park your vehicle at "; PassType = NewOrReNew; objResultVMPass = objmultiVMPass; lstSelectedLocations = new List <Location>(); GetAllStations(); }
public List <PassPrice> GetPassTypesByVehicleTypeID(CustomerVehicle objCustomerVehicle) { DALExceptionManagment objExceptionlog = new DALExceptionManagment(); List <PassPrice> lstPassPrice = null; DataTable resultdt = new DataTable(); try { using (SqlConnection sqlconn_obj = new SqlConnection(SqlHelper.GetDBConnectionString())) { using (SqlCommand sqlcmd_obj = new SqlCommand("CTAPP_PROC_GETPASSTYPESBYVEHICLETYPEID", sqlconn_obj)) { sqlcmd_obj.CommandType = CommandType.StoredProcedure; sqlcmd_obj.Parameters.AddWithValue("@VehicleTypeID", objCustomerVehicle.VehicleTypeID); sqlcmd_obj.Parameters.AddWithValue("@LocationID", objCustomerVehicle.LocationID); sqlconn_obj.Open(); SqlDataAdapter sqldap = new SqlDataAdapter(sqlcmd_obj); sqldap.Fill(resultdt); if (resultdt.Rows.Count > 0) { lstPassPrice = new List <PassPrice>(); for (var i = 0; i < resultdt.Rows.Count; i++) { PassPrice objPassPrice = new PassPrice(); objPassPrice.PassIndex = i; objPassPrice.PassPriceID = resultdt.Rows[i]["PassPriceID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[i]["PassPriceID"]); objPassPrice.PassCode = resultdt.Rows[i]["PassCode"] == DBNull.Value ? "" : Convert.ToString(resultdt.Rows[i]["PassCode"]); objPassPrice.StationAccess = resultdt.Rows[i]["StationAccess"] == DBNull.Value ? "" : Convert.ToString(resultdt.Rows[i]["StationAccess"]); objPassPrice.StartDate = resultdt.Rows[i]["StartDate"] == DBNull.Value ? (Nullable <DateTime>)null : Convert.ToDateTime(resultdt.Rows[i]["StartDate"]); objPassPrice.EndDate = resultdt.Rows[i]["EndDate"] == DBNull.Value ? (Nullable <DateTime>)null : Convert.ToDateTime(resultdt.Rows[i]["EndDate"]); objPassPrice.Duration = resultdt.Rows[i]["Duration"] == DBNull.Value ? "" : Convert.ToString(resultdt.Rows[i]["Duration"]); objPassPrice.Price = resultdt.Rows[i]["Price"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[i]["Price"]); objPassPrice.PriceDisplay = "₹ " + (resultdt.Rows[i]["Price"] == DBNull.Value ? "0" : Convert.ToString(resultdt.Rows[i]["Price"])) + " /-"; objPassPrice.TagType = Convert.ToInt32(resultdt.Rows[i]["TagType"]); objPassPrice.TagPrice = Convert.ToDecimal(resultdt.Rows[i]["TagPrice"]); objPassPrice.VehicleTypeID = resultdt.Rows[i]["VehicleTypeID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[i]["VehicleTypeID"]); objPassPrice.PassTypeID = resultdt.Rows[i]["PassTypeID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[i]["PassTypeID"]); objPassPrice.PassTypeName = resultdt.Rows[i]["PassTypeName"] == DBNull.Value ? "" : Convert.ToString(resultdt.Rows[i]["PassTypeName"]); objPassPrice.PassTypeCode = resultdt.Rows[i]["PassTypeCode"] == DBNull.Value ? "" : Convert.ToString(resultdt.Rows[i]["PassTypeCode"]);//New objPassPrice.PassBordorColour = "#a3a3a3"; objPassPrice.PassBackgroundColour = "#FFFFFF"; objPassPrice.PassTextColour = "#a3a3a3"; lstPassPrice.Add(objPassPrice); } } } } } catch (Exception ex) { objExceptionlog.InsertException(ex.Message, "DALPass", "Proc: " + "CTAPP_PROC_GETPASSTYPESBYVEHICLETYPEID", "GetPassTypesByVehicleTypeID"); } return(lstPassPrice); }
public ActionResult Edit([Bind(Include = "PassId,Price,ItemId")] PassPrice passPrice) { if (ModelState.IsValid) { db.Entry(passPrice).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ItemId = new SelectList(db.Items, "ItemId", "Title", passPrice.ItemId); return(View(passPrice)); }
private async void LstVehiclePasses_ItemSelected(object sender, SelectedItemChangedEventArgs e) { try { PassPrice selectedPass = (PassPrice)e.SelectedItem; if (selectedPass != null) { if (selectedPass.PassTypeID.PassTypeCode == "EP" || selectedPass.PassTypeID.PassTypeCode == "DP")//Event/Day Pass { if (App.Current.Properties.ContainsKey("MultiSelectionLocations")) { App.Current.Properties.Remove("MultiSelectionLocations"); } await Navigation.PushAsync(new DailyPass(PassCategory, selectedPass)); } else if (selectedPass.PassTypeID.PassTypeCode == "WP")//Weekly Pass { if (App.Current.Properties.ContainsKey("MultiSelectionLocations")) { App.Current.Properties.Remove("MultiSelectionLocations"); } await Navigation.PushAsync(new WeeklyPassPage(PassCategory, selectedPass)); } else if (selectedPass.PassTypeID.PassTypeCode == "MP" && (selectedPass.StationAccess.ToUpper() == "Single Station".ToUpper()))//Montly Pass -Single Station { if (App.Current.Properties.ContainsKey("MultiSelectionLocations")) { App.Current.Properties.Remove("MultiSelectionLocations"); } await Navigation.PushAsync(new MonthlyPassPage(PassCategory, selectedPass)); } else if (selectedPass.PassTypeID.PassTypeCode == "MP" && (selectedPass.StationAccess.ToUpper() == "Multi Station".ToUpper() || selectedPass.StationAccess.ToUpper() == "Multi Stations".ToUpper()))//Montly Pass -Multiple Station { await Navigation.PushAsync(new MultiStationPassPage(PassCategory, selectedPass)); } else if (selectedPass.PassTypeID.PassTypeCode == "MP" && (selectedPass.StationAccess.ToUpper() == "All Station".ToUpper() || selectedPass.StationAccess.ToUpper() == "All Stations".ToUpper()))//Montly Pass -Multiple Station { if (App.Current.Properties.ContainsKey("MultiSelectionLocations")) { App.Current.Properties.Remove("MultiSelectionLocations"); } await Navigation.PushAsync(new MonthlyPassPage(PassCategory, selectedPass)); } } ((ListView)LstVehiclePasses).SelectedItem = null; } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "NewPassPage.xaml.cs", "", "LstVehiclePasses_ItemSelected"); } }
// GET: PassPrices/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PassPrice passPrice = db.PassPrices.Find(id); if (passPrice == null) { return(HttpNotFound()); } return(View(passPrice)); }
// GET: PassPrices/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PassPrice passPrice = db.PassPrices.Find(id); if (passPrice == null) { return(HttpNotFound()); } ViewBag.ItemId = new SelectList(db.Items, "ItemId", "Title", passPrice.ItemId); return(View(passPrice)); }
public CustomerVehiclePass() { CustomerVehicleID = new CustomerVehicle(); PrimaryLocationParkingLotID = new LocationParkingLot(); PassCardTypeMapperID = new PassCardTypeMapper(); PaymentTypeID = new PaymentType(); CreatedBy = new User(); PassPriceID = new PassPrice(); PassTypeID = new PassType(); LocationID = new Location(); PassPurchaseLocationID = new LocationParkingLot(); SuperVisorID = new User(); NFCCardSoldByID = new User(); NFCCardSoldFromID = new ApplicationType(); NFCCardPaymentID = new PaymentType(); NFCCardActivatedByID = new User(); NFCSoldLotID = new LocationParkingLot(); CardTypeID = new CardType(); }
public ActionResult Create([Bind(Include = "PassId,Price,ItemId")] PassPrice passPrice) { if (ModelState.IsValid) { passPrice.title = passPrice.SelectTitle(); passPrice.Quantity = passPrice.SelctQuantity(); passPrice.Picture = passPrice.SelctPicture(); passPrice.Date = DateTime.Now; passPrice.OriginalPrice = passPrice.SelctPrice(); passPrice.Price = passPrice.TotalPrice(); db.PassPrices.Add(passPrice); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ItemId = new SelectList(db.Items, "ItemId", "Title", passPrice.ItemId); return(View(passPrice)); }
private async void FourWheeler_Tapped(object sender, EventArgs e) { IsOnline = VerifyInternet(); if (IsOnline) { svgTwo.Source = "resource://InstaConsumer.Resources.grey_circle_bike.svg"; svgFour.Source = "resource://InstaConsumer.Resources.blue_circle_car.svg"; VehicleTypeID = VehicleTypeCodes.FourWheelerTypeID; stkDueAmount.IsVisible = false; DueAmount = 0; DueCustomerParkingSlotID = 0; objPassPrice = null; stkSingleStation.IsVisible = true; stkAllStation.IsVisible = false; stkMultiStation.IsVisible = false; GetListOfCustomerVehicleWithType(VehicleTypeID); GetListOfLocationsByVehicleType(VehicleTypeID, LocationID); } else { await DisplayAlert("", "Please check your network connectivity", "Ok"); } }
protected override void OnAppearing() { DueCustomerParkingSlotID = 0; DueAmount = 0; objPassPrice = null; stkDueAmount.IsVisible = false; stkSingleStation.IsVisible = true; stkAllStation.IsVisible = false; stkMultiStation.IsVisible = false; if (VehicleTypeID == 0) { VehicleTypeID = VehicleTypeCodes.TwoWheelerTypeID; } if (VehicleTypeID == VehicleTypeCodes.TwoWheelerTypeID) { svgTwo.Source = "resource://InstaConsumer.Resources.blue_circle_bike.svg"; svgFour.Source = "resource://InstaConsumer.Resources.grey_circle_car.svg"; } else if (VehicleTypeID == VehicleTypeCodes.FourWheelerTypeID) { svgTwo.Source = "resource://InstaConsumer.Resources.grey_circle_bike.svg"; svgFour.Source = "resource://InstaConsumer.Resources.blue_circle_car.svg"; } IsOnline = VerifyInternet(); if (IsOnline) { GetListOfCustomerVehicleWithType(VehicleTypeID); GetListOfLocationsByVehicleType(VehicleTypeID, LocationID); } else { DisplayAlert("", "Please check your network connectivity", "Ok"); } }
public GeneratePass(PassPrice obj_passPrice, List <Location> location, OCustomerVehicle obj_CustomerVehicle, bool isMulti) { InitializeComponent(); ShowLoading(true); lst_Location = new List <Location>(); objCustomerVehicle = obj_CustomerVehicle; objLocation = location; objpassPrice = obj_passPrice; lblPriceDisplay.Text = "₹ " + Convert.ToString(Convert.ToDouble(objpassPrice.Price + objpassPrice.DueAmount)) + " /-"; this.BindingContext = objpassPrice; PassType = obj_passPrice.PassTypeName.ToUpper(); dal_Pass = new DALPass(); IsMulti = isMulti; if (isMulti) { string str = string.Empty; for (int i = 0; i < location.Count; i++) { str = str + location[i].LocationName + ", "; objLoc = new Location(); objLoc.LocationNumber = i + 1; objLoc.LocationName = location[i].LocationName; lst_Location.Add(objLoc); } LocationName = str.Substring(0, str.Length - 2).Trim(); } else { LocationName = location[0].LocationName; objLoc = new Location(); objLoc.LocationNumber = 1; objLoc.LocationName = location[0].LocationName; lst_Location.Add(objLoc); } lstLocation.ItemsSource = lst_Location; lblModel.Text = obj_CustomerVehicle.Model; lblRegistrationNumber.Text = obj_CustomerVehicle.RegistrationNumber; imgVehicle.Source = obj_CustomerVehicle.VehicleImage; DateTime startDate = DateTime.Now; if (obj_passPrice.PassCode.ToUpper() == "DP") { lblLineStation.IsVisible = true; lblStation.IsVisible = true; lblAllStation.IsVisible = false; lstLocation.IsVisible = true; StartDate = startDate; ExpiryDate = startDate; } else if (obj_passPrice.PassCode.ToUpper() == "2W WP" || obj_passPrice.PassCode.ToUpper() == "4W WP") { lblLineStation.IsVisible = true; lblStation.IsVisible = true; lblAllStation.IsVisible = false; lstLocation.IsVisible = true; StartDate = startDate; ExpiryDate = startDate.AddDays((Convert.ToInt32(obj_passPrice.Duration) - 1)); } else if (obj_passPrice.PassCode.ToUpper() == "2W ALL STATION" || obj_passPrice.PassCode.ToUpper() == "4W ALL STATION") { IsMultiLot = true; lblLineStation.IsVisible = false; lblStation.IsVisible = false; lblAllStation.IsVisible = true; lstLocation.IsVisible = false; StartDate = startDate; ExpiryDate = startDate.AddDays((Convert.ToInt32(obj_passPrice.Duration) - 1)); } else { lblLineStation.IsVisible = true; lblStation.IsVisible = true; lblAllStation.IsVisible = false; lstLocation.IsVisible = true; StartDate = startDate; ExpiryDate = startDate.AddDays((Convert.ToInt32(obj_passPrice.Duration) - 1)); } if (obj_passPrice.PassTypeCode == "EP")// Event Pass { lblLineStation.IsVisible = true; lblStation.IsVisible = true; lblAllStation.IsVisible = false; obj_passPrice.Duration = (obj_passPrice.Duration == null || obj_passPrice.Duration == "0" || obj_passPrice.Duration == "") ? "0" : obj_passPrice.Duration; // EP Start Date Validation if (DateTime.Now.Date >= Convert.ToDateTime(obj_passPrice.StartDate).Date&& DateTime.Now.Date <= Convert.ToDateTime(obj_passPrice.EndDate).Date) { obj_passPrice.StartDate = DateTime.Now.Date; } StartDate = Convert.ToDateTime(obj_passPrice.StartDate); ExpiryDate = Convert.ToDateTime(obj_passPrice.EndDate); } lblFrom.Text = StartDate.ToString("d MMM yyyy, hh:mm tt", CultureInfo.CreateSpecificCulture("en-US")); lblTo.Text = ExpiryDate.ToString("d MMM yyyy, hh:mm tt", CultureInfo.CreateSpecificCulture("en-US")); string fromdatesplit = lblFrom.Text.Split(',')[0]; string fromtimesplit = lblFrom.Text.Split(',')[1]; lblFrom.Text = fromdatesplit; lblFromTime.Text = "06:00 AM"; string toDatesplit = lblTo.Text.Split(',')[0]; string toTimesplit = lblTo.Text.Split(',')[1]; lblTo.Text = toDatesplit; lblToTime.Text = "10:00 PM"; price = obj_passPrice.Price; ShowLoading(false); }
public WeeklyPassPage(string NewOrReNew, PassPrice objvmPass) { InitializeComponent(); dal_Exceptionlog = new DALExceptionManagment(); dal_Pass = new DALPass(); objCustomerPass = new CustomerVehiclePass(); dal_DALCheckIn = new DALCheckIn(); IsNewORReNew = NewOrReNew; objResultVMPass = objvmPass; int daystoexpire = 0; int passduration = 0; try { passduration = objResultVMPass.Duration == "" || objResultVMPass.Duration == null ? 0 : (Convert.ToInt32(objResultVMPass.Duration) - 1); objResultVMPass.EndDate = Convert.ToDateTime(objResultVMPass.StartDate).AddDays(passduration); if (NewOrReNew == "New Pass") { labelGeneratePassPageTitle.Text = "GENERATE PASS"; } else if (NewOrReNew == "ReNew Pass") { labelGeneratePassPageTitle.Text = "RENEW PASS"; //Get ReNew Customer Details From APP Properties if (App.Current.Properties.ContainsKey("ReNewPassCustomerVehicle")) { CustomerVehiclePass objReNewVehicle = (CustomerVehiclePass)App.Current.Properties["ReNewPassCustomerVehicle"]; objCustomerPass.CustomerVehiclePassID = objReNewVehicle.CustomerVehiclePassID; objCustomerPass.CustomerVehicleID = objReNewVehicle.CustomerVehicleID; objCustomerPass.CustomerVehicleID.CustomerID.CustomerID = objReNewVehicle.CustomerVehicleID.CustomerID.CustomerID; entryRegistrationNumber.Text = objReNewVehicle.CustomerVehicleID.RegistrationNumber; entryPhoneNumber.Text = objReNewVehicle.CustomerVehicleID.CustomerID.PhoneNumber; entryName.Text = objReNewVehicle.CustomerVehicleID.CustomerID.Name; entryRegistrationNumber.IsReadOnly = true; entryPhoneNumber.IsReadOnly = true; entryName.IsReadOnly = true; daystoexpire = (Convert.ToDateTime(objReNewVehicle.ExpiryDate).Date - DateTime.Now.Date).Days; if (daystoexpire >= 0) { daystoexpire = (daystoexpire + 1); passduration = (passduration + daystoexpire); labelValidTo.Text = Convert.ToDateTime(objResultVMPass.StartDate).AddDays(passduration).ToString("dd MMM yyyy"); objResultVMPass.EndDate = Convert.ToDateTime(objResultVMPass.StartDate).AddDays(passduration); } else { objResultVMPass.EndDate = Convert.ToDateTime(objResultVMPass.StartDate).AddDays(passduration); } GetVehiceDueAmont(objReNewVehicle.CustomerVehicleID.RegistrationNumber, objResultVMPass.VehicleTypeID.VehicleTypeCode); } } labelPassType.Text = objResultVMPass.PassTypeID.PassTypeName.ToUpper(); labelPassStationAccess.Text = objResultVMPass.StationAccess.ToUpper(); labelPassAmount.Text = String.Format("{0:0.#}", objResultVMPass.Price); labelValidFrom.Text = Convert.ToDateTime(objResultVMPass.StartDate).ToString("dd MMM yyyy"); labelValidTo.Text = Convert.ToDateTime(objResultVMPass.EndDate).ToString("dd MMM yyyy"); imgCustomerVehcileType.Source = objResultVMPass.VehicleTypeID.VehicleIcon; if (App.Current.Properties.ContainsKey("LoginUser")) { User objloginuser = (User)App.Current.Properties["LoginUser"]; labelParkingLocation.Text = objloginuser.LocationParkingLotID.LocationID.LocationName + " Station Only"; if (!string.IsNullOrEmpty(objloginuser.LocationParkingLotID.LotCloseTime)) { objResultVMPass.EndDate = Convert.ToDateTime((Convert.ToDateTime(objResultVMPass.EndDate).ToString("dd MMM yyyy")) + " " + objloginuser.LocationParkingLotID.LotCloseTime); } } } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "WeeklyPassPage.xaml.cs", "", "WeeklyPassPage"); } }
public MonthlyPassPage(string NewOrReNew, PassPrice objvmPass) { InitializeComponent(); dal_Exceptionlog = new DALExceptionManagment(); dal_Pass = new DALPass(); objCustomerPass = new CustomerVehiclePass(); dal_DALCheckIn = new DALCheckIn(); objResultVMPass = objvmPass; IsNewORReNew = NewOrReNew; int passduration = 0; passduration = objResultVMPass.Duration == "" || objResultVMPass.Duration == null ? 0 : (Convert.ToInt32(objResultVMPass.Duration) - 1); if (NewOrReNew == "New Pass") { labelGeneratePassPageTitle.Text = "GENERATE PASS"; slADDNFC.IsVisible = true; objResultVMPass.EndDate = Convert.ToDateTime(objResultVMPass.StartDate).AddDays(passduration); } else if (NewOrReNew == "ReNew Pass") { labelGeneratePassPageTitle.Text = "RENEW PASS"; slADDNFC.IsVisible = false; //Get ReNew Customer Details From APP Properties if (App.Current.Properties.ContainsKey("ReNewPassCustomerVehicle")) { CustomerVehiclePass objReNewVehicle = (CustomerVehiclePass)App.Current.Properties["ReNewPassCustomerVehicle"]; objCustomerPass.CustomerVehiclePassID = objReNewVehicle.CustomerVehiclePassID; objCustomerPass.CustomerVehicleID = objReNewVehicle.CustomerVehicleID; objCustomerPass.CustomerVehicleID.CustomerID.CustomerID = objReNewVehicle.CustomerVehicleID.CustomerID.CustomerID; objCustomerPass.IssuedCard = objReNewVehicle.IssuedCard; entryRegistrationNumber.Text = objReNewVehicle.CustomerVehicleID.RegistrationNumber; entryPhoneNumber.Text = objReNewVehicle.CustomerVehicleID.CustomerID.PhoneNumber; entryName.Text = objReNewVehicle.CustomerVehicleID.CustomerID.Name; entryRegistrationNumber.IsReadOnly = true; entryPhoneNumber.IsReadOnly = true; entryName.IsReadOnly = true; lblCardType.Text = "ADD TAG"; //+ objResultVMPass.CardTypeID.CardTypeName; if (objReNewVehicle.IssuedCard) { checkAddNFCCard.IsChecked = true; labelInclude.Text = "(Including Tag)"; labelPassAmount.Text = String.Format("{0:0.#}", (objReNewVehicle.PassPriceID.Price + objReNewVehicle.PassPriceID.CardPrice)); } else { labelInclude.Text = ""; labelPassAmount.Text = (objReNewVehicle.PassPriceID.Price).ToString("N2"); } int daystoexpire = (Convert.ToDateTime(objReNewVehicle.ExpiryDate).Date - DateTime.Now.Date).Days; if (daystoexpire >= 0) { daystoexpire = (daystoexpire + 1); passduration = (passduration + daystoexpire); objResultVMPass.EndDate = Convert.ToDateTime(objResultVMPass.StartDate).AddDays(passduration); } else { objResultVMPass.EndDate = Convert.ToDateTime(objResultVMPass.StartDate).AddDays(passduration); } GetVehiceDueAmont(objReNewVehicle.CustomerVehicleID.RegistrationNumber, objResultVMPass.VehicleTypeID.VehicleTypeCode); } } FillPassDetails(); }
private void colView_SelectionChanged(object sender, SelectionChangedEventArgs e) { IsOnline = VerifyInternet(); if (IsOnline) { var model = e.CurrentSelection.FirstOrDefault() as PassPrice; if (model != null) { int index = Convert.ToInt32(model.PassIndex); for (int i = 0; i < lst_PassPrice.Count; i++) { lst_PassPrice[i].PassBordorColour = "#a3a3a3"; lst_PassPrice[i].PassBackgroundColour = "#FFFFFF"; lst_PassPrice[i].PassTextColour = "#a3a3a3"; } lst_PassPrice[index].PassBordorColour = "#1976d3"; lst_PassPrice[index].PassBackgroundColour = "#1976d3"; lst_PassPrice[index].PassTextColour = "#FFFFFF"; objPassPrice = lst_PassPrice[index]; lstSelectedLocations = new List <Location>(); if (DueAmount > 0) { stkDueAmount.IsVisible = true; lblDue.Text = "₹ " + Convert.ToString(Convert.ToDouble(DueAmount)) + "/-"; lblPass.Text = "₹ " + Convert.ToString(Convert.ToDouble(objPassPrice.Price)) + "/-"; lblTotal.Text = "₹ " + Convert.ToString(Convert.ToDouble(DueAmount + objPassPrice.Price)) + "/-"; } else { stkDueAmount.IsVisible = false; lblDue.Text = "₹ " + Convert.ToString(Convert.ToDouble(DueAmount)) + "/-"; lblPass.Text = "₹ " + Convert.ToString(Convert.ToDouble(objPassPrice.Price)) + "/-"; lblTotal.Text = "₹ " + Convert.ToString(Convert.ToDouble(DueAmount + objPassPrice.Price)) + "/-"; } if (objPassPrice.PassCode.ToUpper() == "2W MSP" || objPassPrice.PassCode.ToUpper() == "4W MSP") { ShowLoading(false); stkSingleStation.IsVisible = false; stkMultiStation.IsVisible = true; stkAllStation.IsVisible = false; if (App.Current.Properties.ContainsKey("apitoken")) { List <Location> obj_listLocation = new List <Location>(); CustomerVehicle objCustomerVehicle = new CustomerVehicle(); objCustomerVehicle.VehicleTypeID = VehicleTypeID; obj_listLocation = dal_LocationParkingLots.GetListOfMultiLocationsByVehicleType(Convert.ToString(App.Current.Properties["apitoken"]), objCustomerVehicle); if (obj_listLocation.Count > 0) { lstStations.ItemsSource = obj_listLocation; } else { lstStations.ItemsSource = null; DisplayAlert("", "Locations not found!", "Ok"); } } } else if (objPassPrice.PassCode.ToUpper() == "2W ALL STATION" || objPassPrice.PassCode.ToUpper() == "4W ALL STATION") { ShowLoading(false); stkSingleStation.IsVisible = false; stkMultiStation.IsVisible = false; stkAllStation.IsVisible = true; } else { stkSingleStation.IsVisible = true; stkMultiStation.IsVisible = false; stkAllStation.IsVisible = false; List <Location> objLocation = new List <Location>(); Location location = new Location(); location.LocationID = LocationID; location.LocationName = LocationName; objLocation.Add(location); ShowLoading(false); } colView.ItemsSource = null; colView.ItemsSource = lst_PassPrice; } } else { DisplayAlert("", "Please check your network connectivity", "Ok"); } }
private async void btn_GeneratePassClicked(object sender, EventArgs e) { try { IsOnline = VerifyInternet(); if (IsOnline) { if (CustomerVehicleID == 0) { DisplayAlert("", "Please select Registration Number of your Vehicle", "Ok"); return; } if (objPassPrice == null) { DisplayAlert("", "Please select Type of Pass", "Ok"); return; } if (objPassPrice.PassPriceID == 0) { DisplayAlert("", "Please select Type of Pass", "Ok"); return; } bool pass_result = ValidateCustomerVehiclePass(CustomerVehicleID); if (!pass_result) { PassPrice obj_passPrice = objPassPrice; if (DueAmount >= 0) { obj_passPrice.DueCustomerParkingSlotID = DueCustomerParkingSlotID; obj_passPrice.DueAmount = DueAmount; } else { obj_passPrice.DueCustomerParkingSlotID = 0; obj_passPrice.DueAmount = 0; } if (obj_passPrice.PassCode.ToUpper() == "2W MSP" || obj_passPrice.PassCode.ToUpper() == "4W MSP") { ShowLoading(false); if (lstSelectedLocations.Count == 0 || lstSelectedLocations.Count == 1) { ShowLoading(false); DisplayAlert("", "Please select minimum 2 Location", "Ok"); } else { ShowLoading(false); await Navigation.PushAsync(new GeneratePass(obj_passPrice, lstSelectedLocations, objOCustomerVehicle, true)); } } else { List <Location> objLocation = new List <Location>(); Location location = new Location(); location.LocationID = LocationID; location.LocationName = LocationName; objLocation.Add(location); ShowLoading(false); await Navigation.PushAsync(new GeneratePass(obj_passPrice, objLocation, objOCustomerVehicle, false)); } } } else { await DisplayAlert("", "Please check your network connectivity", "Ok"); } } catch (Exception ex) { DisplayAlert("Failed - Generate Passes", Convert.ToString(ex.Message), "Ok"); } }
public DailyPass(string NewOrReNew, PassPrice objvmPass) { InitializeComponent(); dal_Exceptionlog = new DALExceptionManagment(); dal_Pass = new DALPass(); IsNewORReNew = NewOrReNew; objResultVMPass = objvmPass; objCustomerPass = new CustomerVehiclePass(); try { if (NewOrReNew == "New Pass") { labelGeneratePassPageTitle.Text = "GENERATE PASS"; } else if (NewOrReNew == "ReNew Pass") { labelGeneratePassPageTitle.Text = "RENEW PASS"; //Get ReNew Customer Details From APP Properties if (App.Current.Properties.ContainsKey("ReNewPassCustomerVehicle")) { CustomerVehiclePass objReNewVehicle = (CustomerVehiclePass)App.Current.Properties["ReNewPassCustomerVehicle"]; objCustomerPass.CustomerVehiclePassID = objReNewVehicle.CustomerVehiclePassID; objCustomerPass.CustomerVehicleID = objReNewVehicle.CustomerVehicleID; objCustomerPass.CustomerVehicleID.CustomerID.CustomerID = objReNewVehicle.CustomerVehicleID.CustomerID.CustomerID; entryRegistrationNumber.Text = objReNewVehicle.CustomerVehicleID.RegistrationNumber; entryPhoneNumber.Text = objReNewVehicle.CustomerVehicleID.CustomerID.PhoneNumber; entryName.Text = objReNewVehicle.CustomerVehicleID.CustomerID.Name; entryRegistrationNumber.IsReadOnly = true; entryPhoneNumber.IsReadOnly = true; entryName.IsReadOnly = true; GetVehiceDueAmont(objReNewVehicle.CustomerVehicleID.RegistrationNumber, objResultVMPass.VehicleTypeID.VehicleTypeCode); } } labelPassType.Text = objResultVMPass.PassTypeID.PassTypeName.ToUpper(); labelPassStationAccess.Text = objResultVMPass.StationAccess.ToUpper(); labelPassAmount.Text = String.Format("{0:0.#}", objResultVMPass.Price); imgCustomerVehcileType.Source = objResultVMPass.VehicleTypeID.VehicleIcon; if (objResultVMPass.PassTypeID.PassTypeCode == "EP")// Event Pass { objResultVMPass.Duration = (objResultVMPass.Duration == null || objResultVMPass.Duration == "0" || objResultVMPass.Duration == "") ? "0" : objResultVMPass.Duration; // EP Start Date Validation if (DateTime.Now.Date >= Convert.ToDateTime(objResultVMPass.StartDate).Date&& DateTime.Now.Date <= Convert.ToDateTime(objResultVMPass.EndDate).Date) { objResultVMPass.StartDate = DateTime.Now.Date; } labelValidFrom.Text = Convert.ToDateTime(objResultVMPass.StartDate).ToString("dd MMM yyyy"); labelValidTo.Text = Convert.ToDateTime(objResultVMPass.EndDate).ToString("dd MMM yyyy"); } else if (objResultVMPass.PassTypeID.PassTypeCode == "DP") { labelValidFrom.Text = Convert.ToDateTime(objResultVMPass.StartDate).ToString("dd MMM yyyy, hh:mm tt"); labelValidTo.Text = Convert.ToDateTime(objResultVMPass.EndDate).ToString("dd MMM yyyy, hh:mm tt"); } if (App.Current.Properties.ContainsKey("LoginUser")) { User objloginuser = (User)App.Current.Properties["LoginUser"]; labelParkingLocation.Text = objloginuser.LocationParkingLotID.LocationID.LocationName + " Station Only"; if (!string.IsNullOrEmpty(objloginuser.LocationParkingLotID.LotCloseTime)) { objResultVMPass.EndDate = Convert.ToDateTime((Convert.ToDateTime(objResultVMPass.EndDate).ToString("dd MMM yyyy")) + " " + objloginuser.LocationParkingLotID.LotCloseTime); } } } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "DailyPass.xaml.cs", "", "DailyPass"); } }
public VMPassPrice() { PassTypeID = new PassTypes(); PassPriceID = new PassPrice(); }