//Floating Lable Code End public MyProfile(OCustomer customer) { InitializeComponent(); ShowLoading(true); dal_Customer = new DALCustomer(); CustomerID = customer.CustomerID; Gender_static = customer.Gender; txtName.Text = customer.Name; txtPhoneNumber.Text = customer.PhoneNumber; txtEmail.Text = customer.Email; imgProfile.Source = customer.ProfileImage == null ? "profilepic.png" : ImageSource.FromStream(() => new MemoryStream(ByteArrayCompressionUtility.Decompress(customer.ProfileImage))); imgCameraByteData = customer.ProfileImage == null ? null : new MemoryStream(ByteArrayCompressionUtility.Decompress(customer.ProfileImage)).ToArray(); if (customer.YearOfBirth != 0) { txtYearOfBirth.Text = Convert.ToString(customer.YearOfBirth); } else { txtYearOfBirth.Text = ""; } ShowLoading(false); //Floating Lable Code Start lblName.TranslationX = lblPhoneNumber.TranslationX = lblEmail.TranslationX = lblYear.TranslationX = 10; lblName.FontSize = lblPhoneNumber.FontSize = lblEmail.FontSize = lblYear.FontSize = _placeholderFontSize; lblName.TextColor = lblPhoneNumber.TextColor = lblEmail.TextColor = lblYear.TextColor = Color.Gray; if (string.IsNullOrEmpty(txtName.Text)) { TransitionToPlaceholder(true); } else { TransitionToTitle(true); } if (string.IsNullOrEmpty(txtPhoneNumber.Text)) { TransitionToPlaceholder_PhoneNo(true); } else { TransitionToTitle_PhoneNo(true); } if (string.IsNullOrEmpty(txtEmail.Text)) { TransitionToPlaceholder_Email(true); } else { TransitionToTitle_Email(true); } if (string.IsNullOrEmpty(txtYearOfBirth.Text)) { TransitionToPlaceholder_YearofBirth(true); } else { TransitionToTitle_YearofBirth(true); } txtName.Focus(); //Floating Lable Code End }
public void DeCompressMessages() { decomperessedBuffer = ByteArrayCompressionUtility.Decompress(compressedData); }
private void ImageViolation_Clicked(object sender, EventArgs e) { try { if (objresult.VehicleParkingImage != null) { popupImageView.IsVisible = true; imgViolationpopupImage.Source = ImageSource.FromStream(() => new MemoryStream(ByteArrayCompressionUtility.Decompress(objresult.VehicleParkingImage))); labelViolationImageLocation.Text = objresult.VehicleImageLottitude + "," + objresult.VehicleImageLongitude + Environment.NewLine + Convert.ToDateTime(objresult.CreatedOn).ToString("dd MMM yyyy"); } } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "ViolationVehicleInformation.xaml.cs", "", "ImageViolation_Clicked"); } }
public MasterHomePage() { InitializeComponent(); dal_Exceptionlog = new DALExceptionManagment(); dal_Menubar = new DALMenubar(); try { if (App.Current.Properties.ContainsKey("LoginUser")) { User loginUser = (User)App.Current.Properties["LoginUser"]; labelUserName.Text = loginUser.UserName.ToUpper(); labelUserID.Text = "ID: " + Convert.ToString(loginUser.UserCode); if (loginUser.Photo != null && loginUser.Photo.Length > 0) // Show User Profile Image { imgProfile.Source = ImageSource.FromStream(() => new MemoryStream(ByteArrayCompressionUtility.Decompress(loginUser.Photo))); } if (loginUser.UserTypeID.UserTypeName.ToUpper() == "Administrator".ToUpper()) { AdminHomePage adminhomePage = new AdminHomePage(); Detail = new NavigationPage(adminhomePage); } else { CheckIn checkInPage = new CheckIn(); Detail = new NavigationPage(checkInPage); } IsPresented = false; } } catch (Exception ex) { } }
private void LoadParkedVehicleDetails(int customerParkingLotID) { try { string vehicleType = string.Empty; if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken")) { objresult = objHome.GetSelectedParkedVehicleDetails(Convert.ToString(App.Current.Properties["apitoken"]), customerParkingLotID); if (objresult.CustomerParkingSlotID != 0) { labelParkingLocation.Text = objresult.LocationParkingLotID.LocationID.LocationName + "-" + objresult.LocationParkingLotID.LocationParkingLotName; labelBayNumber.Text = "Bay Number " + objresult.LocationParkingLotID.ParkingBayID.ParkingBayRange; labelCheckInBy.Text = objresult.CreatedByName + " #" + objresult.UserCode; labelCheckInFrom.Text = objresult.ExpectedStartTime == null ? "" : Convert.ToDateTime(objresult.ExpectedStartTime).ToString("dd MMM yyyy, hh:mm tt"); labelCheckInTo.Text = objresult.ActualEndTime == null ? "" : Convert.ToDateTime(objresult.ActualEndTime).ToString("dd MMM yyyy, hh:mm tt"); imageParkingFeeImage.Source = "rupee_black.png"; decimal parkingAmount = objresult.PaidAmount; labelParkingFeesDetails.Text = parkingAmount.ToString("N2") + "/-"; labelPaidDueAmountDetails.Text = "( Parking Amount:" + Math.Abs(objresult.Amount - objresult.PaidDueAmount).ToString("N2") + "/-, " + "Paid Due Amount:" + objresult.PaidDueAmount.ToString("N2") + "/- )"; TimeSpan parkingduration = Convert.ToDateTime(objresult.ActualEndTime) - Convert.ToDateTime(objresult.ExpectedStartTime); if (objresult.Duration != "" && objresult.Duration != string.Empty) { var parkhours = ((Math.Abs(parkingduration.Hours) == 0 || Math.Abs(parkingduration.Hours) == 1)) ? Convert.ToInt32(objresult.Duration) : Math.Abs(parkingduration.Hours); labelParkingPaymentType.Text = "Paid for " + string.Format(parkhours + "hr") + " - By " + objresult.PaymentTypeID.PaymentTypeName; } labelVehicleDetails.Text = objresult.CustomerVehicleID.RegistrationNumber; imageVehicleImage.Source = objresult.CustomerVehicleID.VehicleTypeID.VehicleIcon; vehicleType = objresult.CustomerVehicleID.VehicleTypeID.VehicleTypeDisplayName; User objloginuser = (User)App.Current.Properties["LoginUser"]; slSpotExpireTimeDisplay.IsVisible = true; slVehicleWarning.IsVisible = (objresult.ViolationWarningCount >= 3) ? false : true; lblWarningCount.Text = (objresult.ViolationWarningCount > 3) ? "" : Convert.ToString(objresult.ViolationWarningCount) + " Warning(s) Completed"; lblWarningCount.IsVisible = true; imgbtnPrint.IsVisible = true; if (objloginuser.UserTypeID.UserTypeName.ToUpper() != "Operator".ToUpper()) { slFOC.IsVisible = true; } if (objresult.ApplicationTypeID.ApplicationTypeCode == "P") { labelParkingFeesDetails.Text = "Pass Check-In"; labelParkingPaymentType.Text = ""; imageParkingFeeImage.Source = ""; labelPaidDueAmountDetails.Text = ""; } if (objresult.StatusID.StatusCode.ToUpper() == "G") { imgbtnPrint.IsVisible = false; slSpotExpireTimeDisplay.IsVisible = false; slFeesDetails.IsVisible = false; slFOC.IsVisible = false; slClamp.IsVisible = false; chkWarning.IsVisible = false; slVehicleWarning.IsVisible = false; labelParkingFeesDetails.Text = "Free of charge - Government Vehicle"; labelParkingPaymentType.Text = ""; labelPaidDueAmountDetails.Text = ""; imgGovPhone.Source = "phone.png"; imgGovPhone.HeightRequest = 20; labelPhoneNumber.Text = objresult.CustomerID.PhoneNumber; lblWarningCount.IsVisible = false; if (objresult.GovernmentVehicleImage != null) { imageGovernmentVehicle.Source = ImageSource.FromStream(() => new MemoryStream(ByteArrayCompressionUtility.Decompress(objresult.GovernmentVehicleImage))); imageGovernmentVehicle.HeightRequest = 150; labelGovImageLocation.Text = objresult.VehicleImageLottitude + "," + objresult.VehicleImageLongitude + Environment.NewLine + Convert.ToDateTime(objresult.CreatedOn).ToString("dd MMM yyyy"); } else { imageGovernmentVehicle.IsVisible = false; imageGovernmentVehicle.HeightRequest = 0; } } if (objresult.ActualEndTime != null) { DateTime exptendime = Convert.ToDateTime(objresult.ActualEndTime); DateTime CurrentTime = DateTime.Now; TimeSpan t = CurrentTime - exptendime; labelSpotExpiresTime.Text = string.Format("{0:%h} h : {0:%m} m", t); } #region Clamp and Warning data loading checkBoxClampVehicle.IsChecked = objresult.IsClamp; checkBoxClampVehicle.IsEnabled = !objresult.IsClamp; chkWarning.IsChecked = objresult.IsWarning; chkWarning.IsEnabled = !objresult.IsWarning; slCash.IsVisible = (objresult.ClampFees > 0) ? true : false; slEPay.IsVisible = (objresult.ClampFees > 0) ? true : false; lblClampFees.Text = (objresult.ClampFees > 0) ? objresult.ClampFees.ToString("N2") : "0.00"; lblParkingFees.Text = "0.00"; lblTotal.Text = objresult.ClampFees.ToString("N2"); if (objresult.StatusID.StatusCode.ToUpper() == "G") { slCheckOut.IsVisible = false; if (objloginuser.UserTypeID.UserTypeName.ToUpper() != "Operator".ToUpper()) { slCheckOut.IsVisible = true; imgbtnPrint.IsVisible = true; } } else { slCheckOut.IsVisible = (objresult.ClampFees > 0) ? false : true; } if (objresult.ViolationReasonID.ViolationReasonID != 0) { for (int x = 0; x < lstReasons.Count; x++) { if (lstReasons[x].ViolationReasonID == objresult.ViolationReasonID.ViolationReasonID) { pickerViolationReason.SelectedIndex = x; pickerViolationReason.IsEnabled = false; checkBoxClampVehicle.IsEnabled = false; chkWarning.IsEnabled = false; } } slClampReason.IsVisible = true; } frmClampbutton.IsVisible = false; slPaymentAndExpand.IsVisible = true; #endregion try { if (receiptlines != null && receiptlines.Length > 0) { receiptlines[0] = "\x1B\x21\x08" + " " + "HMRL PARKING" + "\x1B\x21\x00" + "\n"; receiptlines[1] = "\x1B\x21\x01" + " " + objresult.LocationParkingLotID.LocationID.LocationName + objresult.LocationParkingLotID.LocationParkingLotName + "\x1B\x21\x00\n"; receiptlines[2] = "" + "\n"; receiptlines[3] = "\x1B\x21\x08" + vehicleType + ":" + objresult.CustomerVehicleID.RegistrationNumber + "\x1B\x21\x00\n"; receiptlines[4] = "\x1B\x21\x01" + (objresult.ActualStartTime == null ? "" : "In:" + Convert.ToDateTime(objresult.ActualStartTime).ToString("dd MMM yyyy,hh:mm tt")) + "\x1B\x21\x00" + "\n"; receiptlines[5] = "\x1B\x21\x01" + "Paid: Rs" + objresult.Amount.ToString("N2") + "(Up to " + objresult.Duration + " hours)" + "\x1B\x21\x00\n"; receiptlines[6] = "\x1B\x21\x01" + "Valid Till:" + (objresult.ActualEndTime == null ? "" : Convert.ToDateTime(objresult.ActualEndTime).ToString("dd MMM yyyy,hh:mm tt")) + "\x1B\x21\x00\n"; receiptlines[7] = "\x1B\x21\x01" + "Parked at: (Bays)" + objresult.LocationParkingLotID.ParkingBayID.ParkingBayRange + "\x1B\x21\x00\n"; receiptlines[8] = "\x1B\x21\x06" + "Operator Id :" + objresult.UserCode + "\x1B\x21\x00\n"; receiptlines[9] = "\x1B\x21\x01" + "(Supervisor Mobile:" + objresult.SuperVisorID.PhoneNumber + ")" + "\x1B\x21\x00\n"; receiptlines[10] = "\x1B\x21\x06" + "Security available " + objresult.LocationParkingLotID.LotOpenTime + "-" + objresult.LocationParkingLotID.LotCloseTime + "\x1B\x21\x00\n"; receiptlines[11] = "\x1B\x21\x01" + "We are not responsible for your valuable items like laptop, wallet,helmet etc." + "\x1B\x21\x00\n"; receiptlines[12] = "\x1B\x21\x06" + "GST Number 36AACFZ1015E1ZL" + "\x1B\x21\x00\n"; receiptlines[13] = "\x1B\x21\x06" + "Amount includes 18% GST" + "\x1B\x21\x00\n"; receiptlines[14] = "" + "\n"; receiptlines[15] = "" + "\n"; } } catch (Exception ex) { } objresult.CreatedBy = objloginuser.UserID; } else { DisplayAlert("Alert", "Vehicle details unvailable,Please contact Admin", "Ok"); } } } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "PassCheckInVehicleInformation.xaml.cs", "", "LoadParkedVehicleDetails"); } }