public CustomerParkingSlot VerifyVehicleInCheckInStatus(VehicleCheckIn objVehicle) { CustomerParkingSlot objCustomerParkingSlot = new CustomerParkingSlot(); DataTable resultdt = new DataTable(); try { using (SqlConnection sqlconn_obj = new SqlConnection(SqlHelper.GetDBConnectionString())) { using (SqlCommand sqlcmd_obj = new SqlCommand("OPAPP_PROC_VerifyVehicleInCheckInStatus", sqlconn_obj)) { sqlcmd_obj.CommandType = CommandType.StoredProcedure; sqlcmd_obj.Parameters.AddWithValue("@LocationID", (objVehicle.LocationID == 0) ? (object)DBNull.Value : Convert.ToInt32(objVehicle.LocationID)); sqlcmd_obj.Parameters.AddWithValue("@LocationParkingLotID", (objVehicle.LocationParkingLotID == 0) ? (object)DBNull.Value : Convert.ToInt32(objVehicle.LocationParkingLotID)); sqlcmd_obj.Parameters.AddWithValue("@VehicleTypeCode", objVehicle.VehicleTypeCode); sqlcmd_obj.Parameters.AddWithValue("@RegistrationNumber", objVehicle.RegistrationNumber == "" ? (object)DBNull.Value : objVehicle.RegistrationNumber); sqlconn_obj.Open(); SqlDataAdapter sqldap = new SqlDataAdapter(sqlcmd_obj); sqldap.Fill(resultdt); if (resultdt.Rows.Count > 0) { objCustomerParkingSlot.CustomerParkingSlotID = resultdt.Rows[0]["CustomerParkingSlotID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["CustomerParkingSlotID"]); objCustomerParkingSlot.CustomerID.CustomerID = resultdt.Rows[0]["CustomerID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["CustomerID"]); objCustomerParkingSlot.CustomerID.Name = Convert.ToString(resultdt.Rows[0]["Name"]); objCustomerParkingSlot.LocationParkingLotID.LocationID.LocationID = resultdt.Rows[0]["LocationID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["LocationID"]); objCustomerParkingSlot.LocationParkingLotID.LocationID.LocationName = Convert.ToString(resultdt.Rows[0]["LocationName"]); objCustomerParkingSlot.LocationParkingLotID.LocationParkingLotID = resultdt.Rows[0]["LocationParkingLotID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["LocationParkingLotID"]); objCustomerParkingSlot.LocationParkingLotID.LocationParkingLotName = Convert.ToString(resultdt.Rows[0]["LocationParkingLotName"]); objCustomerParkingSlot.LocationParkingLotID.ParkingBayID.ParkingBayID = resultdt.Rows[0]["ParkingBayID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["ParkingBayID"]); objCustomerParkingSlot.LocationParkingLotID.ParkingBayID.ParkingBayName = Convert.ToString(resultdt.Rows[0]["ParkingBayName"]); objCustomerParkingSlot.LocationParkingLotID.ParkingBayID.ParkingBayRange = Convert.ToString(resultdt.Rows[0]["ParkingBayRange"]); objCustomerParkingSlot.ExpectedStartTime = resultdt.Rows[0]["ExpectedStartTime"] == DBNull.Value ? (Nullable <DateTime>)null : Convert.ToDateTime(resultdt.Rows[0]["ExpectedStartTime"]); objCustomerParkingSlot.ExpectedEndTime = resultdt.Rows[0]["ExpectedEndTime"] == DBNull.Value ? (Nullable <DateTime>)null : Convert.ToDateTime(resultdt.Rows[0]["ExpectedEndTime"]); objCustomerParkingSlot.ActualStartTime = resultdt.Rows[0]["ActualStartTime"] == DBNull.Value ? (Nullable <DateTime>)null : Convert.ToDateTime(resultdt.Rows[0]["ActualStartTime"]); objCustomerParkingSlot.ActualEndTime = resultdt.Rows[0]["ActualEndTime"] == DBNull.Value ? (Nullable <DateTime>)null : Convert.ToDateTime(resultdt.Rows[0]["ActualEndTime"]); objCustomerParkingSlot.VehicleTypeID.VehicleTypeID = resultdt.Rows[0]["VehicleTypeID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["VehicleTypeID"]); objCustomerParkingSlot.VehicleTypeID.VehicleTypeCode = Convert.ToString(resultdt.Rows[0]["VehicleTypeCode"]); objCustomerParkingSlot.VehicleTypeID.VehicleTypeName = Convert.ToString(resultdt.Rows[0]["VehicleTypeName"]); objCustomerParkingSlot.Duration = Convert.ToString(resultdt.Rows[0]["Duration"]); objCustomerParkingSlot.PaymentTypeID.PaymentTypeID = resultdt.Rows[0]["PaymentTypeID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["PaymentTypeID"]); objCustomerParkingSlot.PaymentTypeID.PaymentTypeName = Convert.ToString(resultdt.Rows[0]["PaymentTypeName"]); objCustomerParkingSlot.CreatedBy = resultdt.Rows[0]["UserID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["UserID"]); objCustomerParkingSlot.CreatedByName = Convert.ToString(resultdt.Rows[0]["UserName"]); objCustomerParkingSlot.Amount = resultdt.Rows[0]["Amount"] == DBNull.Value ? 0 : Convert.ToDecimal(resultdt.Rows[0]["Amount"]); objCustomerParkingSlot.CustomerVehicleID.RegistrationNumber = Convert.ToString(resultdt.Rows[0]["RegistrationNumber"]); objCustomerParkingSlot.CustomerVehicleID.CustomerVehicleID = resultdt.Rows[0]["CustomerVehicleID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["CustomerVehicleID"]); objCustomerParkingSlot.IsClamp = resultdt.Rows[0]["IsClamp"] == DBNull.Value ? false : Convert.ToBoolean(resultdt.Rows[0]["IsClamp"]); objCustomerParkingSlot.StatusID.StatusID = resultdt.Rows[0]["StatusID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["StatusID"]); objCustomerParkingSlot.StatusID.StatusCode = Convert.ToString(resultdt.Rows[0]["StatusCode"]); } } } } catch (Exception ex) { objExceptionlog.InsertException("WebAPI", ex.Message, "DALCheckIn", "Proc: " + "OPAPP_PROC_VerifyVehicleInCheckInStatus", "VerifyVehicleInCheckInStatus"); } return(objCustomerParkingSlot); }
public string VerifyVehicleCheckInStatus() // Verify Vehicle already parked { string alreadyCheckIn = string.Empty; try { if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken")) { VehicleCheckIn objPassVehicle = new VehicleCheckIn(); User objloginuser = (User)App.Current.Properties["LoginUser"]; objPassVehicle.LocationID = objloginuser.LocationParkingLotID.LocationID.LocationID; objPassVehicle.LocationParkingLotID = objloginuser.LocationParkingLotID.LocationParkingLotID; objPassVehicle.VehicleTypeCode = SelectedVehicle; objPassVehicle.RegistrationNumber = entryRegistrationNumber.Text; CustomerParkingSlot resultobj = dal_DALCheckIn.VerifyVehicleChekcInStatus(Convert.ToString(App.Current.Properties["apitoken"]), objPassVehicle); if (resultobj.CustomerParkingSlotID != 0) { alreadyCheckIn = resultobj.LocationParkingLotID.LocationID.LocationName + "-" + resultobj.LocationParkingLotID.LocationParkingLotName; } } } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "CheckInPage.xaml.cs", "", "VerifyVehicleCheckInStatus"); } return(alreadyCheckIn); }
public ConfirmationPage(VehicleCheckIn obj) { InitializeComponent(); dal_DALCheckIn = new DALCheckIn(); dal_Exceptionlog = new DALExceptionManagment(); ObjblueToothDevicePrinting = new BlueToothDevicePrinting(); LoadVehicleChekInDetails(obj); printerName = ObjblueToothDevicePrinting.GetBlueToothDevices(); }
public Task <int> DeleteItemAsync(VehicleCheckIn objdelCheckIn) { Task <int> deleted = null; try { deleted = db.ExecuteAsync("DELETE FROM VehicleCheckIn WHERE [RegistrationNumber] = ?;", objdelCheckIn.RegistrationNumber); } catch (Exception ex) { throw ex; } return(deleted); }
public VehicleCheckIn GetIVehicleDetailsAsync(string RegistrationNumber) { VehicleCheckIn resultvehicle = new VehicleCheckIn(); try { var rstdata = db.Table <VehicleCheckIn>().Where(i => i.RegistrationNumber == RegistrationNumber).FirstOrDefaultAsync(); resultvehicle = rstdata.Result; } catch (Exception ex) { throw ex; } return(resultvehicle); }
public async void LoadVehicleChekInDetails(VehicleCheckIn obj) { string vehicleTypeName = string.Empty; try { if (obj != null) { objNewCheckIn = obj; labelParkingLocation.Text = obj.LocationName + "-" + obj.LocationParkingLotName + "," + "Bay Number " + "-" + obj.BayRange; if (!string.IsNullOrEmpty(obj.ParkingStartTime) && !string.IsNullOrEmpty(obj.ParkingEndTime)) { //lblValidFrom.Text = Convert.ToDateTime(obj.ParkingStartTime).ToString("dd MMM yyyy hh:mm tt"); //lblValidTo.Text = Convert.ToDateTime(obj.ParkingEndTime).ToString("dd MMM yyyy hh:mm tt"); lblValidFrom.Text = obj.ParkingStartTime; lblValidTo.Text = obj.ParkingEndTime; } ImgVehicleType.Source = obj.VehicleImage; vehicleTypeName = obj.VehicleTypeName; lblRegistrationNumber.Text = obj.RegistrationNumber; lblParkingAmount.Text = "- Rs " + obj.ParkingFees.ToString("N2") + "/-"; lblParkingHours.Text = "for " + obj.ParkingHours.ToString() + " hours"; lblDueAmount.Text = "- Rs " + obj.DueAmount.ToString("N2") + "/-"; lblClampAmount.Text = "- Rs " + obj.ClampFees.ToString("N2") + "/-"; lblChekInAmount.Text = "- Rs " + Convert.ToDecimal(obj.ParkingFees + obj.ClampFees + obj.DueAmount).ToString("N2") + "/-"; lblPaymentTypeCode.Text = obj.PaymentType; decimal GSTPercentage = 18; decimal totalCheckInAmount = Convert.ToDecimal(obj.ParkingFees + obj.ClampFees + obj.DueAmount); decimal GSTAmount = ((totalCheckInAmount) * GSTPercentage) / 100; decimal AmountAfterGST = (totalCheckInAmount) - GSTAmount; string GSTString = "( Rs " + AmountAfterGST.ToString("N2") + " +" + " GST " + GSTPercentage + "%" + " Rs " + GSTAmount.ToString("N2") + ")"; lblAmountWithGSTSplit.Text = GSTString; lblGSTNumber.Text = "GST 36AACFZ1015E1ZL"; if (App.Current.Properties.ContainsKey("LoginUser")) { var objLoginUser = (User)App.Current.Properties["LoginUser"]; lblParkingLotTimmings.Text = objLoginUser.LocationParkingLotID.LotOpenTime + " - " + objLoginUser.LocationParkingLotID.LotCloseTime; lblPhoneNumber.Text = objLoginUser.PhoneNumber; } lblSecurityMessage.Text = "We are not responsible for your personal belongings"; } else { await DisplayAlert("Alert", "Check In vehicle details unavailable.", "Ok"); } } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "ConfirmationPage.xaml.cs", "", "LoadVehicleChekInDetails"); } }
void CurrentHome_OnMessageReceived(ITagInfo tagInfo) { string checkInmsg = string.Empty; try { if (tagInfo == null) { DisplayAlert("Alert", "No tag found", "Ok"); return; } // Customized serial number var identifier = tagInfo.Identifier; var serialNumber = tagInfo.SerialNumber; if (serialNumber != "") { DALCheckIn dal_ChckeIn = new DALCheckIn(); if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken")) { VehicleCheckIn objNFCCardVehicle = new VehicleCheckIn(); User objloginuser = (User)App.Current.Properties["LoginUser"]; objNFCCardVehicle.UserID = objloginuser.UserID; objNFCCardVehicle.LocationID = objloginuser.LocationParkingLotID.LocationID.LocationID; objNFCCardVehicle.LocationParkingLotID = objloginuser.LocationParkingLotID.LocationParkingLotID; objNFCCardVehicle.NFCCardNumber = serialNumber; checkInmsg = dal_ChckeIn.SaveNFCCardVehicleCheckIn(Convert.ToString(App.Current.Properties["apitoken"]), objNFCCardVehicle); if (checkInmsg != "Success") { DisplayAlert("Alert", checkInmsg, "Ok"); } else { LoadParkedVehicle(null); } } else { DisplayAlert("Alert", "NFC Card serial number unable to found.", "Ok"); return; } } } catch (Exception ex) { DisplayAlert("Alert", "Unable to proceed,Please contact Admin" + ex.Message, "Ok"); dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "MasterDetailHomePage.xaml.cs", "", "CurrentHome_OnMessageReceived"); } }
public string GovernmentVehicleCheckIn(VehicleCheckIn obj) { string resultmsg = string.Empty; try { using (SqlConnection sqlconn_obj = new SqlConnection(SqlHelper.GetDBConnectionString())) { using (SqlCommand sqlcmd_obj = new SqlCommand("OPAPP_PROC_SaveGovernmentVehicleCheckIn", sqlconn_obj)) { sqlcmd_obj.CommandType = CommandType.StoredProcedure; sqlcmd_obj.Parameters.AddWithValue("@CustomerID", obj.CustomerID == null || obj.CustomerID == 0 ? (Object)DBNull.Value : obj.CustomerID); sqlcmd_obj.Parameters.AddWithValue("@VehicleTypeCode", obj.VehicleTypeCode); sqlcmd_obj.Parameters.AddWithValue("@LocationParkingLotID", obj.LocationParkingLotID); sqlcmd_obj.Parameters.AddWithValue("@RegistrationNumber", obj.RegistrationNumber); sqlcmd_obj.Parameters.AddWithValue("@BayNumberID", obj.BayNumberID); sqlcmd_obj.Parameters.AddWithValue("@PhoneNumber", obj.PhoneNumber); sqlcmd_obj.Parameters.AddWithValue("@StatusName", obj.StatusName); sqlcmd_obj.Parameters.AddWithValue("@GovernmentVehicleImage", obj.GovernmentVehicleImage); sqlcmd_obj.Parameters.AddWithValue("@UserID", obj.UserID); sqlcmd_obj.Parameters.AddWithValue("@VehicleImageLottitude", obj.VehicleImageLottitude == null || obj.VehicleImageLottitude == 0 ? (Object)DBNull.Value : obj.VehicleImageLottitude); sqlcmd_obj.Parameters.AddWithValue("@VehicleImageLongitude", obj.VehicleImageLongitude == null || obj.VehicleImageLongitude == 0 ? (Object)DBNull.Value : obj.VehicleImageLongitude); sqlconn_obj.Open(); int resultid = sqlcmd_obj.ExecuteNonQuery(); if (resultid > 0) { resultmsg = "Success"; } else { resultmsg = "Fail"; } } } } catch (Exception ex) { objExceptionlog.InsertException("WebAPI", ex.Message, "DALCheckIn", "Proc: " + "OPAPP_PROC_SaveGovernmentVehicleCheckIn", "GovernmentVehicleCheckIn"); throw; } return(resultmsg); }
public CustomerParkingSlot SaveVehicleNewCheckIn(string accessToken, VehicleCheckIn objcheckin) { CustomerParkingSlot objResultCustomerParkingSlot = new CustomerParkingSlot(); 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/postOPAPPVehicleNewCheckIn"; // make the request var json = JsonConvert.SerializeObject(objcheckin); 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) { objResultCustomerParkingSlot = JsonConvert.DeserializeObject <CustomerParkingSlot>(Convert.ToString(apiResult.Object)); } } } } } catch (Exception ex) { throw ex; } return(objResultCustomerParkingSlot); }
//Insert and Update new record public Task <int> SaveOfflineCheckInAsync(VehicleCheckIn objNewCheckIn) { Task <int> output = null; try { if (objNewCheckIn.CustomerParkingSlotID != 0) { return(db.UpdateAsync(objNewCheckIn)); } else { output = db.InsertAsync(objNewCheckIn); } } catch (Exception ex) { throw ex; } return(output); }
public string VerifyPassVehicleCheckInStatus(string vehicleTypeCode, string registrationNumber) // Verify Vehicle already parked { string alreadyCheckIn = string.Empty; try { if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken")) { VehicleCheckIn objPassVehicle = new VehicleCheckIn(); objPassVehicle.RegistrationNumber = registrationNumber; objPassVehicle.VehicleTypeCode = vehicleTypeCode; CustomerParkingSlot resultobj = dal_DALCheckIn.VerifyVehicleChekcInStatus(Convert.ToString(App.Current.Properties["apitoken"]), objPassVehicle); if (resultobj.CustomerParkingSlotID != 0 && resultobj.StatusID.StatusCode == "O") { alreadyCheckIn = resultobj.LocationParkingLotID.LocationID.LocationName + "-" + resultobj.LocationParkingLotID.LocationParkingLotName; } } } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "ReNewPassPage.xaml.cs", "", "VerifyPassVehicleCheckInStatus"); } return(alreadyCheckIn); }
public CustomerParkingSlot SaveVehicleNewCheckIn(VehicleCheckIn obj) { CustomerParkingSlot objCustomerParkingSlot = new CustomerParkingSlot(); DataTable resultdt = new DataTable(); try { using (SqlConnection sqlconn_obj = new SqlConnection(SqlHelper.GetDBConnectionString())) { using (SqlCommand sqlcmd_obj = new SqlCommand("OPAPP_PROC_SaveVehicleNewCheckIn", sqlconn_obj)) { sqlcmd_obj.CommandType = CommandType.StoredProcedure; sqlcmd_obj.Parameters.AddWithValue("@CustomerParkingSlotID", (obj.CustomerParkingSlotID == 0) ? (object)DBNull.Value : obj.CustomerParkingSlotID); sqlcmd_obj.Parameters.AddWithValue("@UserID", obj.UserID); sqlcmd_obj.Parameters.AddWithValue("@LocationID", obj.LocationID); sqlcmd_obj.Parameters.AddWithValue("@LocationParkingLotID", obj.LocationParkingLotID); sqlcmd_obj.Parameters.AddWithValue("@BayNumberID", obj.BayNumberID); sqlcmd_obj.Parameters.AddWithValue("@VehicleTypeCode", obj.VehicleTypeCode); sqlcmd_obj.Parameters.AddWithValue("@RegistrationNumber", obj.RegistrationNumber); sqlcmd_obj.Parameters.AddWithValue("@PhoneNumber", obj.PhoneNumber); sqlcmd_obj.Parameters.AddWithValue("@ParkingStartTime", obj.ParkingStartTime); sqlcmd_obj.Parameters.AddWithValue("@ParkingEndTime", obj.ParkingEndTime); sqlcmd_obj.Parameters.AddWithValue("@PaymentType", obj.PaymentType); sqlcmd_obj.Parameters.AddWithValue("@ParkingHours", obj.ParkingHours); sqlcmd_obj.Parameters.AddWithValue("@ParkingFees", obj.ParkingFees); sqlcmd_obj.Parameters.AddWithValue("@ClampFees", (obj.ClampFees == null || obj.ClampFees == 0) ? (object)DBNull.Value : obj.ClampFees); sqlcmd_obj.Parameters.AddWithValue("@PaidDueAmount", (obj.DueAmount == null || obj.DueAmount == 0) ? (object)DBNull.Value : obj.DueAmount); sqlconn_obj.Open(); SqlDataAdapter sqldap = new SqlDataAdapter(sqlcmd_obj); sqldap.Fill(resultdt); if (resultdt.Rows.Count > 0) { objCustomerParkingSlot.CustomerParkingSlotID = resultdt.Rows[0]["CustomerParkingSlotID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["CustomerParkingSlotID"]); objCustomerParkingSlot.CustomerID.CustomerID = resultdt.Rows[0]["CustomerID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["CustomerID"]); objCustomerParkingSlot.CustomerID.Name = Convert.ToString(resultdt.Rows[0]["Name"]); objCustomerParkingSlot.LocationParkingLotID.LocationID.LocationID = resultdt.Rows[0]["LocationID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["LocationID"]); objCustomerParkingSlot.LocationParkingLotID.LocationID.LocationName = Convert.ToString(resultdt.Rows[0]["LocationName"]); objCustomerParkingSlot.LocationParkingLotID.LocationParkingLotID = resultdt.Rows[0]["LocationParkingLotID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["LocationParkingLotID"]); objCustomerParkingSlot.LocationParkingLotID.LocationParkingLotName = Convert.ToString(resultdt.Rows[0]["LocationParkingLotName"]); objCustomerParkingSlot.LocationParkingLotID.LotOpenTime = Convert.ToString(resultdt.Rows[0]["LotOpenTime"]); objCustomerParkingSlot.LocationParkingLotID.LotCloseTime = Convert.ToString(resultdt.Rows[0]["LotCloseTime"]); objCustomerParkingSlot.LocationParkingLotID.ParkingBayID.ParkingBayID = resultdt.Rows[0]["ParkingBayID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["ParkingBayID"]); objCustomerParkingSlot.LocationParkingLotID.ParkingBayID.ParkingBayName = Convert.ToString(resultdt.Rows[0]["ParkingBayName"]); objCustomerParkingSlot.LocationParkingLotID.ParkingBayID.ParkingBayRange = Convert.ToString(resultdt.Rows[0]["ParkingBayRange"]); objCustomerParkingSlot.ExpectedStartTime = Convert.ToDateTime(resultdt.Rows[0]["ExpectedStartTime"]); objCustomerParkingSlot.ExpectedEndTime = Convert.ToDateTime(resultdt.Rows[0]["ExpectedEndTime"]); objCustomerParkingSlot.ActualStartTime = Convert.ToDateTime(resultdt.Rows[0]["ActualStartTime"]); objCustomerParkingSlot.ActualEndTime = Convert.ToDateTime(resultdt.Rows[0]["ActualEndTime"]); objCustomerParkingSlot.VehicleTypeID.VehicleTypeID = resultdt.Rows[0]["VehicleTypeID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["VehicleTypeID"]); objCustomerParkingSlot.VehicleTypeID.VehicleTypeCode = Convert.ToString(resultdt.Rows[0]["VehicleTypeCode"]); objCustomerParkingSlot.VehicleTypeID.VehicleTypeName = Convert.ToString(resultdt.Rows[0]["VehicleTypeName"]); if (Convert.ToString(resultdt.Rows[0]["VehicleTypeCode"]).ToUpper() == "2W") { objCustomerParkingSlot.VehicleTypeID.VehicleTypeDisplayName = "BIKE"; } else if (Convert.ToString(resultdt.Rows[0]["VehicleTypeCode"]).ToUpper() == "3W") { objCustomerParkingSlot.VehicleTypeID.VehicleTypeDisplayName = "THREE WHEELER"; } else if (Convert.ToString(resultdt.Rows[0]["VehicleTypeCode"]).ToUpper() == "4W") { objCustomerParkingSlot.VehicleTypeID.VehicleTypeDisplayName = "CAR"; } else if (Convert.ToString(resultdt.Rows[0]["VehicleTypeCode"]).ToUpper() == "HW") { objCustomerParkingSlot.VehicleTypeID.VehicleTypeDisplayName = "HEAVY VEHICLE"; } objCustomerParkingSlot.Duration = Convert.ToString(resultdt.Rows[0]["Duration"]); objCustomerParkingSlot.PaymentTypeID.PaymentTypeID = Convert.ToInt32(resultdt.Rows[0]["PaymentTypeID"]); objCustomerParkingSlot.PaymentTypeID.PaymentTypeName = Convert.ToString(resultdt.Rows[0]["PaymentTypeName"]); objCustomerParkingSlot.CreatedBy = resultdt.Rows[0]["UserID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["UserID"]); objCustomerParkingSlot.UserCode = resultdt.Rows[0]["USERCODE"] == DBNull.Value ? "" : Convert.ToString(resultdt.Rows[0]["USERCODE"]); objCustomerParkingSlot.SuperVisorID.UserCode = resultdt.Rows[0]["SUPERVISORCODE"] == DBNull.Value ? "" : Convert.ToString(resultdt.Rows[0]["SUPERVISORCODE"]); objCustomerParkingSlot.SuperVisorID.PhoneNumber = resultdt.Rows[0]["SUPERVISORPHONENUMBER"] == DBNull.Value ? "" : Convert.ToString(resultdt.Rows[0]["SUPERVISORPHONENUMBER"]); objCustomerParkingSlot.CreatedByName = Convert.ToString(resultdt.Rows[0]["UserName"]); objCustomerParkingSlot.Amount = resultdt.Rows[0]["Amount"] == DBNull.Value ? 0 : Convert.ToDecimal(resultdt.Rows[0]["Amount"]); objCustomerParkingSlot.PaidDueAmount = resultdt.Rows[0]["PaidDueAmount"] == DBNull.Value ? 0 : Convert.ToDecimal(resultdt.Rows[0]["PaidDueAmount"]); objCustomerParkingSlot.ClampFees = resultdt.Rows[0]["ClampFee"] == DBNull.Value ? 0 : Convert.ToDecimal(resultdt.Rows[0]["ClampFee"]); objCustomerParkingSlot.PaidAmount = resultdt.Rows[0]["PaidAmount"] == DBNull.Value ? 0 : Convert.ToDecimal(resultdt.Rows[0]["PaidAmount"]); objCustomerParkingSlot.ExtendAmount = resultdt.Rows[0]["ExtendAmount"] == DBNull.Value ? 0 : Convert.ToDecimal(resultdt.Rows[0]["ExtendAmount"]); objCustomerParkingSlot.CustomerVehicleID.RegistrationNumber = Convert.ToString(resultdt.Rows[0]["RegistrationNumber"]); objCustomerParkingSlot.CustomerVehicleID.CustomerVehicleID = resultdt.Rows[0]["CustomerVehicleID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["CustomerVehicleID"]); objCustomerParkingSlot.IsClamp = resultdt.Rows[0]["IsClamp"] == DBNull.Value ? false : Convert.ToBoolean(resultdt.Rows[0]["IsClamp"]); objCustomerParkingSlot.ApplicationTypeID.ApplicationTypeID = resultdt.Rows[0]["ApplicationTypeID"] == DBNull.Value ? 0 : Convert.ToInt32(resultdt.Rows[0]["ApplicationTypeID"]); objCustomerParkingSlot.ApplicationTypeID.ApplicationTypeCode = Convert.ToString(resultdt.Rows[0]["ApplicationTypeCode"]); objCustomerParkingSlot.GSTNumber = "36AACFZ1015E1ZL"; } } } } catch (Exception ex) { objExceptionlog.InsertException("WebAPI", ex.Message, "DALCheckIn", "Proc: " + "OPAPP_PROC_SaveVehicleNewCheckIn", "SaveVehicleNewCheckIn"); } return(objCustomerParkingSlot); }
private async void BtnCheckIn_Clicked(object sender, EventArgs e) { MasterHomePage masterPage = null; string msg = string.Empty; string existingCheckIn = string.Empty; btnCheckIn.IsVisible = false; try { ShowLoading(true); if (App.Current.Properties.ContainsKey("LoginUser") && App.Current.Properties.ContainsKey("apitoken") && objCustomerPass != null) { if (SelectedVehicle != string.Empty) { // Pass holder vehicle Check In ParkingBay objselectedbay = (ParkingBay)pickerBayNumers.SelectedItem; if (objselectedbay != null) { await Task.Run(() => { existingCheckIn = VerifyVehicleCheckInStatus(); if (existingCheckIn == string.Empty) { VehicleCheckIn objPassVehicle = new VehicleCheckIn(); User objloginuser = (User)App.Current.Properties["LoginUser"]; objPassVehicle.UserID = objloginuser.UserID; objPassVehicle.LocationID = objloginuser.LocationParkingLotID.LocationID.LocationID; objPassVehicle.LocationParkingLotID = objloginuser.LocationParkingLotID.LocationParkingLotID; objPassVehicle.VehicleTypeCode = SelectedVehicle; objPassVehicle.BayNumberID = objselectedbay.ParkingBayID; objPassVehicle.RegistrationNumber = entryRegistrationNumber.Text; objPassVehicle.CustomerID = objCustomerPass.CustomerVehicleID.CustomerID.CustomerID; msg = dal_DALCheckIn.SavePassVehicleCheckIn(Convert.ToString(App.Current.Properties["apitoken"]), objPassVehicle); if (msg == "Success") { masterPage = new MasterHomePage(); } } }); if (existingCheckIn == string.Empty) { if (msg == "Success") { await Navigation.PushAsync(masterPage); } else { await DisplayAlert("Alert", "Unable to Check In, Please contact Admin", "Ok"); } } else { await DisplayAlert("Alert", "Vehicle Checked In as Violation at " + existingCheckIn, "Ok"); } } else { await DisplayAlert("Alert", "Please select Bay Number", "Ok"); } } else { await DisplayAlert("Alert", "Please select vehicle type and Registration Number- minimum 6 digits", "Ok"); } } else { await DisplayAlert("Alert", "Unable to Check In, Please contact Admin", "Ok"); } ShowLoading(false); btnCheckIn.IsVisible = true; } catch (Exception ex) { dal_Exceptionlog.InsertException(Convert.ToString(App.Current.Properties["apitoken"]), "Operator App", ex.Message, "ViolationPage.xaml.cs", "", "BtnCheckIn_Clicked"); ShowLoading(false); btnCheckIn.IsVisible = true; } }