/// <summary> /// Author: Josephine Gad /// Date Created: 10/Mar/2014 /// Description: Confirm Service Provider Vehicle Manifest /// </summary> private void ConfirmVehicle() { Int32 iContractIDInt = GlobalCode.Field2Int(uoHiddenFieldContractID.Value); Int16 iVehicleTypeId = GlobalCode.Field2TinyInt(uoDropDownListVehicleType.SelectedValue); DataTable dt = null; try { int iCurrency = GlobalCode.Field2Int(uoDropDownListCurrency.SelectedValue); float fRate = GlobalCode.Field2Float(uoTextBoxRateConfirmed.Text); DateTime dateNow = CommonFunctions.GetCurrentDateTime(); string sTimeSpan = ""; if (uoTextBoxPickupTime.Text.Trim() != "") { sTimeSpan = GlobalCode.Field2DateTimeWithTime(uoTextBoxPickupTime.Text).ToString(); } Int16 iVehicleTypeID = GlobalCode.Field2TinyInt(uoDropDownListVehicleType.SelectedValue); string sAction = GlobalCode.Field2String(Request.QueryString["Action"]); if (User.IsInRole(TravelMartVariable.RolePortSpecialist) && (sAction == "")) { dt = getManifestAmountWithContract(); BLL.PortAgentManifestConfirmVehicle(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value, uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(), sTimeSpan, iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(), "", uoTextBoxDriver.Text, uoTextBoxPlateNo.Text, iVehicleTypeID, uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, iContractIDInt, "Confirmed Vehicle by Service Provider Vendor", "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath), CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt, uoTextBoxTranspoDetails.Text.Trim()); } else if (sAction == "EditAmount") { dt = getManifestAmount(); BLL.PortAgentManifestConfirmVehicleAmount(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value, uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(), iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(), uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, "Changed Amount of Vehicle by RCCL", "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath), CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt); } else if (sAction == "Approve") { BLL.PortAgentManifestConfirmVehicleApprove(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value, uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(), uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, "Approve Service Provider Vehicle Manifest by RCCL", "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath), CommonFunctions.GetDateTimeGMT(dateNow), dateNow); } else if (sAction == "CancelByRCCL" || sAction == "Cancel") { string sDescription = sAction + ": Cancel Service Provider Vehicle Manifest"; BLL.PortAgentManifestConfirmVehicleCancel(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value, uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(), uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, sDescription, "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath), CommonFunctions.GetDateTimeGMT(dateNow), dateNow); } else if (sAction == "Add") { dt = getManifestAmountWithContract(); BLL.PortAgentManifestConfirmVehicleAdd(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value, uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(), iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(), uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, iContractIDInt, iVehicleTypeId, "Create Vehicle Request by RCCL", "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath), CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt); } } catch (Exception ex) { AlertErrorMessage("Confirm Vehicle: " + ex.Message); } finally { if (dt != null) { dt.Dispose(); } } }