protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { uoHiddenFieldUser.Value = GlobalCode.Field2String(Request.QueryString["uId"]); uoHiddenFieldUserName.Value = GlobalCode.Field2String(Session["UserName"]); //Audit Trail string strLogDescription = "User Vessel Maintenance Viewed"; string strFunction = "Page_Load"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(GlobalCode.Field2Int(uoHiddenFieldUser.Value), "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); BindListViewVesselNotInUser(true, false); BindListViewVesselInUser(true); } }
/// <summary> /// Date Created: 06/10/2011 /// Created By: Gabriel Oquialda /// (description) Insert/Update vendor vehicle branch /// </summary> protected void uoButtonVehicleBranchSave_Click(object sender, EventArgs e) { string vendorId = uoDropDownListVendorName.SelectedValue; string country = uoDropDownListCountry.SelectedValue; string city = uoDropDownListCity.SelectedValue; string strLogDescription; string strFunction; bool isValidTest = false; Validate("Header"); isValidTest = IsValid; if (!isValidTest) { return; } VendorMaintenanceBLL.vehicleInsertUpdateVendorBranch(uoTextBoxVendorBranchName.Text, uoTextBoxBranchCode.Text, uoTextBoxVendorAddress.Text, Convert.ToInt32(city), Convert.ToInt32(country), uoTextBoxContactNo.Text, GlobalCode.Field2String(Session["UserName"]), Convert.ToInt32(vendorId), uoTextBoxContactPerson.Text, uoCheckBoxFranchise.Checked, uoHiddenFieldBranchId.Value, GlobalCode.Field2TinyInt(uoRadioButtonListType.SelectedValue)); if (Request.QueryString["vmId"] == "0" || Request.QueryString["vmId"] == null) { //Insert log audit trail (Gabriel Oquialda - 17/11/2011) strLogDescription = "Vehicle vendor branch added."; strFunction = "uoButtonVehicleBranchSave_Click"; DateTime currentDate = CommonFunctions.GetCurrentDateTime(); //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path), // CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); } else { //Insert log audit trail (Gabriel Oquialda - 17/11/2011) strLogDescription = "Vehicle vendor branch updated."; strFunction = "uoButtonVehicleBranchSave_Click"; DateTime currentDate = CommonFunctions.GetCurrentDateTime(); //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path), // CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); } //if (Request.QueryString["vmId"] == "0") //{ Response.Redirect("~/Maintenance/VehicleMaintenanceBranchView.aspx?st=" + Request.QueryString["st"] + "&dt=" + Request.QueryString["dt"] + "&ufn=" + Request.QueryString["ufn"]); //} }
/// <summary> /// Date Created: 01/08/2011 /// Created By: Gabriel Oquialda /// (decription) Loads vendor information /// ----------------------------------------------- /// Date Created: 01/08/2011 /// Created By: Gabriel Oquialda /// (decription) Loads vendor information /// ----------------------------------------------- /// Date Modifed: 06/Aug/2013 /// Created By: Josephine Gad /// (decription) Load Vendor using VendorMaintenanceBLL.VehicleVendorsGetByID /// Use Sessions instead of DataTable /// </summary> private void vendorInfoLoad(Int16 iLoadType) { if (Request.QueryString["vmId"].ToString() != "0") { //Commment for now BY JHO //MeetAndGreetBLL.MeetAndGreetVendorsGetByID(GlobalCode.Field2Int(uoHiddenFieldVehicleVendorIdInt.Value), iLoadType); List <VendorVehicleDetails> listVehicleDetails = new List <VendorVehicleDetails>(); if (Session["MeetAndGreetVendorDetails"] != null) { listVehicleDetails = (List <VendorVehicleDetails>)Session["MeetAndGreetVendorDetails"]; if (listVehicleDetails.Count > 0) { uoTextBoxCity.Text = GlobalCode.Field2String(Session["MeetAndGreetVendorCityFilter"]); uoTextBoxVendorName.Text = listVehicleDetails[0].VendorName; uoTextBoxVendorAddress.Text = listVehicleDetails[0].Address; uoTextBoxWebsite.Text = listVehicleDetails[0].Website; uoTextBoxEmailTo.Text = listVehicleDetails[0].EmailTo; uoTextBoxEmailCc.Text = listVehicleDetails[0].EmailCC; vendorCountryLoad(); if (uoDropDownListCountry.Items.FindByValue(GlobalCode.Field2String(listVehicleDetails[0].CountryID)) != null) { uoDropDownListCountry.SelectedValue = GlobalCode.Field2String(listVehicleDetails[0].CountryID); } vendorCityLoad(0, uoDropDownListCountry.SelectedValue); if (uoDropDownListCity.Items.FindByValue(GlobalCode.Field2String(listVehicleDetails[0].CityID)) != null) { uoDropDownListCity.SelectedValue = GlobalCode.Field2String(listVehicleDetails[0].CityID); } uoTextBoxContactNo.Text = listVehicleDetails[0].ContactNo; uoTextBoxContactPerson.Text = listVehicleDetails[0].ContactPerson; uoTextBoxFaxNo.Text = listVehicleDetails[0].FaxNo; BindVendorTypeList(0); BindVehicleTypeList(0); } } else { uoTextBoxCity.Text = ""; uoTextBoxVendorName.Text = ""; uoTextBoxVendorAddress.Text = ""; uoTextBoxWebsite.Text = ""; uoTextBoxEmailTo.Text = ""; uoTextBoxEmailCc.Text = ""; vendorCountryLoad(); vendorCityLoad(0, uoDropDownListCountry.SelectedValue); uoTextBoxContactNo.Text = ""; uoTextBoxContactPerson.Text = ""; uoTextBoxFaxNo.Text = ""; uoListViewVehicleType.DataSource = null; uoListViewVehicleType.DataBind(); BindVehicleTypeList(1); } } else { //Commment for now BY JHO //MeetAndGreetBLL.MeetAndGreetVendorsGetByID(0, iLoadType); List <VendorVehicleDetails> listVehicleDetails = new List <VendorVehicleDetails>(); uoTextBoxCity.Text = ""; uoTextBoxVendorName.Text = ""; uoTextBoxVendorAddress.Text = ""; uoTextBoxWebsite.Text = ""; uoTextBoxEmailTo.Text = ""; uoTextBoxEmailCc.Text = ""; vendorCountryLoad(); vendorCityLoad(0, uoDropDownListCountry.SelectedValue); uoTextBoxContactNo.Text = ""; uoTextBoxContactPerson.Text = ""; uoTextBoxFaxNo.Text = ""; uoListViewVehicleType.DataSource = null; uoListViewVehicleType.DataBind(); BindVehicleTypeList(1); } }
void insertHotelrequest(string spName, string status) { int?StatusID = null; List <NonTurnRequestBooking> PAH = new List <NonTurnRequestBooking>(); foreach (ListViewDataItem item in uolistviewHotelInfo.Items) { if (status == "Cancel") { StatusID = 5; } else { StatusID = GlobalCode.Field2Int(((HiddenField)item.FindControl("uoHiddenFieldStatusID")).Value); } PAH.Add(new NonTurnRequestBooking { TransHotelID = GlobalCode.Field2Long(((HiddenField)item.FindControl("uoHiddenFieldTransHotelID")).Value), TravelReqID = GlobalCode.Field2Long(((HiddenField)item.FindControl("uoHiddenFieldListTRID")).Value), SeafarerID = GlobalCode.Field2Long(((Label)item.FindControl("uoLblSfID")).Text), IdBigint = GlobalCode.Field2Long(((HiddenField)item.FindControl("uoHiddenFieldListRecLocID")).Value), RecordLocator = GlobalCode.Field2String(((Label)item.FindControl("uoLblRecLoc")).Text), SeqNo = GlobalCode.Field2Int(((HiddenField)item.FindControl("uoHiddenFieldSeqNo")).Value), VendorID = GlobalCode.Field2Int(uoVendorDropDownList.SelectedItem.Value), RoomTypeID = ((Label)item.FindControl("uoLblRoom")).Text == "double" ? 2 : 1, CheckIn = GlobalCode.Field2DateTime(uoTextBoxCheckInDate.Text), CheckOut = GlobalCode.Field2DateTime(((Label)item.FindControl("uoLblCheckOut")).Text), Duration = GlobalCode.Field2Int(((Label)item.FindControl("uoLblNites")).Text) <= 0 ? 1 : GlobalCode.Field2Int(((Label)item.FindControl("uoLblNites")).Text), VoucherAmount = GlobalCode.Field2Double(uoHiddenFieldVoucher.Value), ContractID = GlobalCode.Field2Int(uoHiddenFieldContractID.Value), ApprovedBy = GlobalCode.Field2String(uoTextBoxConfirmedBy.Text), ApprovedDate = DateTime.Now.Date, RoomCount = GlobalCode.Field2Float((((Label)item.FindControl("uoLblRoom"))).Text == "double" ? 0.5 : 1.0), HotelName = GlobalCode.Field2String(uoTextBoxHotelname.Text), //ConfirmRateMoney = GlobalCode.Field2Double(uoTextBoxRateConfirmed.Text), //ContractedRateMoney = GlobalCode.Field2Double(uoTextBoxRateContract.Text), ConfirmRateMoney = GlobalCode.Field2Double(((TextBox)item.FindControl("txtContractedRate")).Text), ContractedRateMoney = GlobalCode.Field2Double(((Label)item.FindControl("lblContractedRate")).Text), EmailTo = GlobalCode.Field2String(uoTextBoxEmailAdd.Text), EmailCC = GlobalCode.Field2String(uoTextBoxCopy.Text), Comment = GlobalCode.Field2String(uoTextBoxComment.Text), Currency = GlobalCode.Field2Int(uoDropDownListCurrency.SelectedItem.Value), ConfirmBy = GlobalCode.Field2String(uoTextBoxConfirmedBy.Text), StatusID = StatusID,//GlobalCode.Field2Int(((HiddenField)item.FindControl("uoHiddenFieldStatusID")).Value),// == 1 ? 2 : 4 , IsMedical = GlobalCode.Field2Bool(((HiddenField)item.FindControl("uoHiddenFieldIsMedical")).Value), UserID = uoHiddenFieldUser.Value }); } GlobalCode gc = new GlobalCode(); DataTable dt = new DataTable(); dt = gc.getDataTable(PAH); PortBLL = new PortAgentBLL(); PortBLL.InsertNonTurnTransactionRequestBooking(dt, spName, uoHiddenFieldUser.Value, uoTextBoxEmailAdd.Text, uoTextBoxCopy.Text); }
/// <summary> /// Author: Muhallidin G Wali /// Date Created: 12/Apr/2015 /// Description: Get the hotel to confirm from Non Turn Port Page /// </summary> private void GetHotelManifestToAdd() { try { ViewState["PortAgenRequestVendor"] = null; DataTable table = new DataTable(); table = CreateTable(); string dt = GlobalCode.Field2String(Request.QueryString["dt"]); var qRow = Request.QueryString["qTravelReqID"]; int PortID = GlobalCode.Field2Int(Request.QueryString["pID"]); int row = GlobalCode.Field2Int(Request.QueryString["pRow"]); int PAID = GlobalCode.Field2Int(Request.QueryString["paID"]); string userID = uoHiddenFieldUser.Value; string[] TableRow = null; if (qRow != null) { TableRow = qRow.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); } DataRow dr; int c1 = 0; int c2 = 1; int c3 = 2; int c4 = 3; if (TableRow != null) { for (var i = 0; i < row; i++) { dr = table.NewRow(); dr["TransHotelID"] = TableRow[c4]; dr["IDBigint"] = TableRow[c1]; dr["TravelReqID"] = TableRow[c2]; dr["SeqNoInt"] = TableRow[c3]; dr["ReqDate"] = GlobalCode.Field2Time(dt); dr["PortID"] = PortID; dr["UserID"] = userID; table.Rows.Add(dr); c1 = c1 + 4; c2 = c2 + 4; c3 = c3 + 4; c4 = c4 + 4; } } uoHiddenFieldStatusID.Value = Request.QueryString["st"]; PortBLL = new PortAgentBLL(); List <NonTurnportGenericList> lst = new List <NonTurnportGenericList>(); lst = PortBLL.GetPortNonTurnHotelReques(0, GlobalCode.Field2Time(dt), PortID, GlobalCode.Field2Int(Request.QueryString["paID"]), userID, table); List <PortAgenRequestVendor> PAList = new List <PortAgenRequestVendor>(); if (uoHiddenFieldStatusID.Value == "1" && uoHiddenFieldRole.Value == TravelMartVariable.RolePortSpecialist) { PAList = lst[0].PortAgenRequestVendor.Where(n => n.VendorID == GlobalCode.Field2Int(Request.QueryString["paID"])).ToList(); } else { PAList = lst[0].PortAgenRequestVendor;; } uoVendorDropDownList.DataSource = PAList; uoVendorDropDownList.DataTextField = "VendorName"; uoVendorDropDownList.DataValueField = "VendorID"; uoVendorDropDownList.DataBind(); uoVendorDropDownList.Items.Insert(0, new ListItem("--Select Vendor--", "0")); uoVendorDropDownList.SelectedIndex = GlobalCode.GetselectedIndex(uoVendorDropDownList, GlobalCode.Field2Int(Request.QueryString["paID"])); uoDropDownListCurrency.DataSource = lst[0].Currency; uoDropDownListCurrency.DataTextField = "Name"; uoDropDownListCurrency.DataValueField = "ID"; uoDropDownListCurrency.DataBind(); uoDropDownListCurrency.Items.Insert(0, new ListItem("--Select Currency--", "0")); uoDropDownListRequestSource.DataSource = lst[0].Requestor; uoDropDownListRequestSource.DataTextField = "Name"; uoDropDownListRequestSource.DataValueField = "ID"; uoDropDownListRequestSource.DataBind(); uoDropDownListRequestSource.Items.Insert(0, new ListItem("--Select Requestor--", "0")); uoDropDownListRequestSource.SelectedIndex = 2; ViewState["PortAgenRequestVendor"] = PAList; //lst[0].PortAgenRequestVendor; uolistviewHotelInfo.DataSource = lst[0].NonTurnPortsLists; uolistviewHotelInfo.DataBind(); var PortAgenRequest = PAList; // lst[0].PortAgenRequestVendor.Where(n => n.VendorID == GlobalCode.Field2Int(Request.QueryString["paID"])).ToList(); if (PortAgenRequest.Count > 0) { uoTextBoxHotelname.Text = uoVendorDropDownList.SelectedItem.Text; uoTextBoxEmailAdd.Text = PortAgenRequest[0].EmailTo; uoTextBoxRateContract.Text = PortAgenRequest[0].DoubleRate.ToString(); uoTextBoxRateContractSingle.Text = PortAgenRequest[0].SingleRate.ToString(); uoTextBoxRateConfirmed.Text = PortAgenRequest[0].DoubleRate.ToString(); uoTextBoxSingleRateConfirmed.Text = PortAgenRequest[0].SingleRate.ToString(); uoTextBoxCheckInDate.Text = GlobalCode.Field2DateTime(Request.QueryString["dt"]).ToString(); uoDropDownListCurrency.SelectedIndex = GlobalCode.GetselectedIndex(uoDropDownListCurrency, PortAgenRequest[0].CurrentID); uoHiddenFieldContractID.Value = PortAgenRequest[0].VendorContractID.ToString(); uoHiddenFieldVoucher.Value = PortAgenRequest[0].Voucher.ToString(); } } catch (Exception e) { throw e; } }
/// <summary> /// Created By: Josephine Gad /// Date Created: 15/08/2012 /// Description: Default page for role Meet & Greet /// --------------------------------------------------- /// Modified By: Josephine Gad /// Date Modified: 11/Aug/2014 /// Description: Edit Page for Service Provider request from Crew Assist Page /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { InitializeValues(); if (!IsPostBack) { //Audit Trail string strLogDescription = ""; if (uoHiddenFieldRole.Value == TravelMartVariable.RoleMeetGreet) { strLogDescription = "Meet & Greet Page Viewed"; } else if (uoHiddenFieldRole.Value == TravelMartVariable.RolePortSpecialist) { strLogDescription = "Service Provider Page Viewed"; } else { strLogDescription = "Meet & Greet or Service Provider Page Viewed"; } string strFunction = "Page_Load"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); Session["strPrevPage"] = Request.RawUrl; uoHiddenFieldDate.Value = Request.QueryString["dt"]; Session["DateFrom"] = uoHiddenFieldDate.Value; //uoHiddenFieldVendorID.Value = GlobalCode.Field2String(Session["UserBranchID"]); uoHiddenFieldUser.Value = GlobalCode.Field2String(Session["UserName"]); if (GlobalCode.Field2String(Session["UserRole"]) == "") { Session["UserRole"] = UserAccountBLL.GetUserPrimaryRole(uoHiddenFieldUser.Value); } uoHiddenFieldRole.Value = GlobalCode.Field2String(Session["UserRole"]); string sChangeDate = ""; if (Request.QueryString["chDate"] != null) { sChangeDate = Request.QueryString["chDate"]; } if (sChangeDate == "1") { uoHiddenFieldPortAgentID.Value = GlobalCode.Field2Int(Session["PortAgentID"]).ToString(); } else { uoHiddenFieldPortAgentID.Value = GlobalCode.Field2Int(Request.QueryString["pid"]).ToString(); Session["PortAgentID"] = uoHiddenFieldPortAgentID.Value; } ListViewHeaderSea.DataSource = null; ListViewHeaderSea.DataBind(); BindPortAgent(); BindSeaportManifest(); BindStatus(); BindDays(); //ControlSettings(); //SetSelectedPort(); } else { if (Session["DateFrom"] != null && GlobalCode.Field2String(Session["DateFrom"]) != "") { uoHiddenFieldDate.Value = GlobalCode.Field2String(Session["DateFrom"]); } else { uoHiddenFieldDate.Value = Request.QueryString["dt"]; } ListViewHeaderSea.DataSource = null; ListViewHeaderSea.DataBind(); uoHiddenFieldLoadType.Value = "1"; HiddenField uoHiddenFieldPopupCalendar = (HiddenField)Master.FindControl("uoHiddenFieldPopupCalendar"); if (uoHiddenFieldPopupCalendar.Value == "1") { uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy"); //SetSelectedPort(); //BindPortAgent(); BindSeaportManifest(); } string sChangeDate = ""; if (Request.QueryString["chDate"] != null) { sChangeDate = Request.QueryString["chDate"]; } if (sChangeDate == "1") { uoHiddenFieldPortAgentID.Value = GlobalCode.Field2Int(Session["PortAgentID"]).ToString(); //BindPortAgent(); BindSeaportManifest(); } } }
protected void uoGridViewMenu_RowCommand(object sender, GridViewCommandEventArgs e) { string strLogDescription; string strFunction; if (e.CommandName == "Delete") { string MenuIdString = e.CommandArgument.ToString(); UserRightsBLL.DeleteMenu(MenuIdString, GlobalCode.Field2String(Session["UserName"])); //Insert log audit trail (Gabriel Oquialda - 17/11/2011) strLogDescription = "User menu deleted. (flagged as inactive)"; strFunction = "uoGridViewMenu_RowCommand"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(MenuIdString), "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); GetMenu(); } else if (e.CommandName == "Activate") { string MenuIdString = e.CommandArgument.ToString(); UserRightsBLL.ActivateMenu(MenuIdString, GlobalCode.Field2String(Session["UserName"])); //Insert log audit trail (Gabriel Oquialda - 17/11/2011) strLogDescription = "User menu activated. (flagged as active)"; strFunction = "uoGridViewMenu_RowCommand"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(MenuIdString), "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); GetMenu(); } }
/// <summary> /// Date Created: 08/07/2011 /// Created By: Marco Abejar /// (description) Get seafarer port info /// ------------------------------------------------------ /// Modified Date: 21/07/2011 /// Modified By: Josephine Gad /// (description) Make header Onsigning/Offsigning dynamic /// ------------------------------------------------------ /// Date Modified: 02/08/2011 /// Modifed By: Josephine Gad /// (description) Add Date Range parameter /// ------------------------------------------------------ /// Date Created: 05/08/2011 /// Modifed By: Josephine gad /// (description) Add parameter seafarer's name, Close DataTable /// </summary> private void GetSFPortTravelDetails() { DataTable PortDataTable = null; try { PortDataTable = SeafarerTravelBLL.GetSFPortTravelDetails(GlobalCode.Field2String(Session["DateFrom"]), GlobalCode.Field2String(Session["DateTo"]), uoHiddenFieldUser.Value, GlobalCode.Field2String(Session["strPendingFilter"]), GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]), GlobalCode.Field2String(Session["City"]), uoDropDownListStatus.SelectedValue, uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(), GlobalCode.Field2String(Session["Port"]), uoDropDownListVessel.SelectedValue, uoDropDownListNationality.SelectedValue, uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue, uoHiddenFieldRole.Value); uolistviewPortTravelInfo.DataSource = PortDataTable; uolistviewPortTravelInfo.DataBind(); } catch (Exception ex) { throw ex; } finally { if (PortDataTable != null) { PortDataTable.Dispose(); } } }
/// <summary> /// Date Created: 16/11/2011 /// Created By: Josephine Gad /// (description) Create excel file of hotel manifest and email /// --------------------------------------------------------------------------- /// </summary> private void BindPortManifestExcel() { DataTable dt = null; try { SeafarerTravelBLL bll = new SeafarerTravelBLL(); dt = bll.GetSFPortTravelDetailsWithCount(GlobalCode.Field2String(Session["DateFrom"]), Session["Date"].ToString(), uoHiddenFieldUser.Value, GlobalCode.Field2String(Session["strPendingFilter"]), GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]), GlobalCode.Field2String(Session["City"]), uoDropDownListStatus.SelectedValue, uoDropDownListFilterBy.SelectedValue, uoTextBoxFilter.Text.Trim(), GlobalCode.Field2String(Session["Port"]), uoDropDownListVessel.SelectedValue, uoDropDownListNationality.SelectedValue, uoDropDownListGender.SelectedValue, uoDropDownListRank.SelectedValue, uoHiddenFieldRole.Value, Int16.Parse(uoHiddenFieldByVessel.Value), Int16.Parse(uoHiddenFieldByName.Value), Int16.Parse(uoHiddenFieldByRecLoc.Value), Int16.Parse(uoHiddenFieldByE1ID.Value), Int16.Parse(uoHiddenFieldByDateOnOff.Value), Int16.Parse(uoHiddenFieldByStatus.Value), Int16.Parse(uoHiddenFieldByPort.Value), Int16.Parse(uoHiddenFieldByRank.Value), Int16.Parse(uoHiddenFieldByPortStatus.Value), Int16.Parse(uoHiddenFieldByNationality.Value), 0, uolistviewPortTravelInfoPager.TotalRowCount); uoGridViewPortManifest.Visible = true; if (dt.Rows.Count > 0) { uoGridViewPortManifest.DataSource = dt; } else { uoGridViewPortManifest.EmptyDataText = "No Record."; } uoGridViewPortManifest.DataBind(); ////auto save string FilePath = MapPath("~/Extract/PortManifest/"); string sDate = DateTime.Now.ToString(TravelMartVariable.DateTimeFormatFileExtension); FileInfo FileName = new FileInfo(FilePath + "PortManifest_" + sDate + ".xls"); Response.Clear(); Response.ClearContent(); StringWriter stringWrite = new StringWriter(); HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); uoGridViewPortManifest.RenderControl(htmlWrite); FileStream fs = new FileStream(FileName.FullName, FileMode.Create); StreamWriter sWriter = new StreamWriter(fs, Encoding.GetEncoding("UTF-8")); sWriter.Write(stringWrite.ToString().Trim()); sWriter.Close(); fs.Close(); //Use below line instead of Response.End() to avoid Error: Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.; HttpContext.Current.ApplicationInstance.CompleteRequest(); ManifestSendEmail("Travelmart: Port Manifest", "This is a sample Port Manifest", FileName.FullName); AlertMessage("Email sent."); } catch (Exception ex) { DateTime currentDate = CommonFunctions.GetCurrentDateTime(); ErrorBLL.InsertError(ex.Message, ex.StackTrace.ToString(), Request.Url.AbsolutePath, currentDate, CommonFunctions.GetDateTimeGMT(currentDate), GlobalCode.Field2String(Session["UserName"])); AlertMessage(ex.Message); } finally { if (dt != null) { dt.Dispose(); } uoGridViewPortManifest.Visible = false; } }
protected void uoButtonSave_Click(object sender, EventArgs e) { string strLogDescription; string strFunction; int cId = Convert.ToInt32(Session["CountryId"].ToString()); if (cId == 0) { Int32 CityID = MasterfileBLL.cityAddMasterfileInsert(Convert.ToInt32(uoDropDownListCountry.SelectedValue), uoTextBoxCityCode.Text, uoTextBoxCity.Text, GlobalCode.Field2String(Session["UserName"])); //Insert log audit trail (Gabriel Oquialda - 14/02/2012) strLogDescription = "City added."; strFunction = "uoButtonSave_Click"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(CityID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); OpenParentPage(); } else { int cityId = GlobalCode.Field2Int(Session["CityId"]); MasterfileBLL.cityAddMasterfileUpdate(cId, cityId, uoTextBoxCity.Text, uoTextBoxCityCode.Text, GlobalCode.Field2String(Session["UserName"])); //Insert log audit trail (Gabriel Oquialda - 14/02/2012) strLogDescription = "City updated."; strFunction = "uoButtonSave_Click"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(cityId, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); OpenParentPage(); } }
/// <summary> /// Date Created: 30/09/2011 /// Created By: Josephine Gad /// (description) Get vessel list /// --------------------------------------------------------------------------- /// </summary> private void GetVessel() { DataTable VesselDataTable = null; try { VesselDataTable = VesselBLL.GetVessel(GlobalCode.Field2String(Session["UserName"]), GlobalCode.Field2String(Session["DateFrom"]), GlobalCode.Field2String(Session["DateTo"]), GlobalCode.Field2String(Session["Region"]), GlobalCode.Field2String(Session["Country"]), GlobalCode.Field2String(Session["City"]), GlobalCode.Field2String(Session["Port"]), uoHiddenFieldRole.Value); uoDropDownListVessel.Items.Clear(); ListItem item = new ListItem("--Select Ship--", "0"); uoDropDownListVessel.Items.Add(item); uoDropDownListVessel.DataSource = VesselDataTable; uoDropDownListVessel.DataTextField = "VesselName"; uoDropDownListVessel.DataValueField = "VesselID"; uoDropDownListVessel.DataBind(); } catch (Exception ex) { throw ex; } finally { if (VesselDataTable != null) { VesselDataTable.Dispose(); } } }
/// Date Created: 17/02/2012 /// Created By: Gabriel Oquialda /// (description) Audit trail logs protected void CityLogAuditTrail() { string strLogDescription = ""; string strFunction = ""; if (Session["CountryId"].ToString() != "0") { strLogDescription = "Edit linkbutton for city editor clicked."; } else { strLogDescription = "Add button for city editor clicked."; } strFunction = "CityLogAuditTrail"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.UrlReferrer.AbsolutePath), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); }
/// <summary> /// Date Created: 27/10/2011 /// Created By: Josephine Gad /// (description) Get users menu by UserName /// ---------------------------------------------------------------- /// Date Modified: 16/08/2012 /// Modified By: Josephine Gad /// (description) Add each role's home page /// ---------------------------------------------------------------- /// Date Modified: 16/08/2012 /// Modified By: Jefferson Bermundo /// (description) Add Homepage for HotelVendor /// ---------------------------------------------------------------- /// Date Modified: 25/Apr/2013 /// Modified By: Josephine Gad /// (description) Change Hotel Vendor's Page to HotelConfirmManifest.aspx Page /// ---------------------------------------------------------------- /// Date Modified: 7/May/2013 /// Modified By: Marco Abejar /// (description) Change Crew Assist Page to HotelDashboardRoomType5.aspx Page /// /// ---------------------------------------------------------------- /// </summary> /// private void BindMenuByUser() { string URLString = ""; string MenuString = ""; string UserName = GlobalCode.Field2String(Session["UserName"]); //MUser.GetUserName(); string UserRole = GlobalCode.Field2String(Session["UserRole"]);; //MUser.GetUserRole(); if (Session["UserMenu"] == null) { if (Request.QueryString["ufn"] != null) { //GlobalCode.Field2String(Session["DateFrom"]) = Request.QueryString["dt"]; Session["DateFrom"] = Request.QueryString["dt"]; //URLString = "?ufn=" + Request.QueryString["ufn"]; //URLString = "?ufn" + GlobalCode.Field2String(Session["strPrevPage"]); //URLString = "?ufn=" + Request.QueryString["ufn"] + "&dt=" + GlobalCode.Field2DateTime(GlobalCode.Field2String(Session["DateFrom"])).ToString(); //gelo URLString = "?ufn=" + Request.QueryString["ufn"] + "&dt=" + Request.QueryString["dt"]; //gelo } MenuString = "<ul id =\"nav\">"; //if (UserRole != TravelMartVariable.RoleHotelSpecialist && UserRole != TravelMartVariable.RoleHotelVendor && UserRole != "") //{ // MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../Manifest.aspx" + URLString + "\">Home</a></li>"; //} if (UserRole == TravelMartVariable.RoleHotelSpecialist) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../HotelDashboardRoomType5.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleMeetGreet || UserRole == TravelMartVariable.RolePortSpecialist) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../MeetAndGreet/MeetAndGreet.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleCrewAdmin) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../CrewAdmin/CrewAdmin.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleHotelVendor) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../Hotel/HotelConfirmManifest.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleSystemAnalyst) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../SystemAnalyst/ExceptionPNR.aspx" + URLString + "\">Home</a></li>"; } else { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../Manifest.aspx" + URLString + "\">Home</a></li>"; } DataTable MenuDataTable = null; DataTable SubMenuDataTable = null; DataTable SubMenuDataTable2 = null; string PageUrlString = ""; string SubMenuString = ""; string SubMenuString2 = ""; try { MenuDataTable = UserRightsBLL.GetMenuByUser(UserName); if (MenuDataTable.Rows.Count > 0) { foreach (DataRow MenuRow in MenuDataTable.Rows) { PageUrlString = MenuRow["colPageNameVarchar"].ToString(); PageUrlString = (PageUrlString == "" ? "#" : "../" + PageUrlString + URLString); MenuString += "<li><a href=\"" + PageUrlString + "\">" + MenuRow["colDisplayNameVarchar"].ToString() + "</a>"; SubMenuDataTable = UserRightsBLL.GetSubMenuByUser(UserName, MenuRow["colPageIDInt"].ToString()); if (SubMenuDataTable.Rows.Count > 0) { SubMenuString = "<ul>"; foreach (DataRow SubMenuRow in SubMenuDataTable.Rows) { PageUrlString = SubMenuRow["colPageNameVarchar"].ToString(); PageUrlString = (PageUrlString == "" ? "#" : "../" + PageUrlString + URLString); SubMenuString += "<li><a href=\"" + PageUrlString + "\">" + SubMenuRow["colDisplayNameVarchar"].ToString() + "</a>"; SubMenuDataTable2 = UserRightsBLL.GetSubMenuByUser(UserName, SubMenuRow["colPageIDInt"].ToString()); if (SubMenuDataTable2.Rows.Count > 0) { SubMenuString2 = "<ul>"; foreach (DataRow SubMenuRow2 in SubMenuDataTable2.Rows) { PageUrlString = SubMenuRow2["colPageNameVarchar"].ToString(); PageUrlString = (PageUrlString == "" ? "#" : "../" + PageUrlString + URLString); SubMenuString2 += "<li><a href=\"" + PageUrlString + "\">" + SubMenuRow2["colDisplayNameVarchar"].ToString() + "</a></li>"; } SubMenuString2 += "</ul>"; SubMenuString += SubMenuString2; } SubMenuString += "</li>"; } SubMenuString += "</ul>"; MenuString += SubMenuString; } MenuString += "</li>"; } } } catch (Exception ex) { throw ex; } finally { if (MenuDataTable != null) { MenuDataTable.Dispose(); } if (SubMenuDataTable != null) { SubMenuDataTable.Dispose(); } if (SubMenuDataTable2 != null) { SubMenuDataTable2.Dispose(); } } if (UserRole != TravelMartVariable.RoleImmigration) { MenuString += "<li><a runat=\"server\" id=\"uoASearch\" href=\"../ManifestSearchFilter.aspx" + URLString + "\">Search</a></li>"; } MenuString += "</ul>"; Session["UserMenu"] = MenuString; //Store menu string in Cache for 10 minutes //Cache.Insert("UserMenu", MenuString, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(10)); } if (Session["CurrentDate"] == null) { Session["CurrentDate"] = Request.QueryString["dt"].ToString(); //Store menu string in Cache for 10 minutes //Cache.Insert("CurrentDate", Request.QueryString["dt"].ToString(), null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(10)); } if (Session["UserMenu"] != null && Session["CurrentDate"] != null) { string sMenu = Session["UserMenu"].ToString(); string sDate = Session["CurrentDate"].ToString(); string sDateNew = Request.QueryString["dt"].ToString(); //sDate = sDate.Replace("_", "/"); if (!sDateNew.Contains("-")) { sDateNew = sDateNew.Replace("_", "/"); sMenu = sMenu.Replace(sDate, sDateNew); Session["UserMenu"] = sMenu; Session["CurrentDate"] = sDateNew; //Store menu string in Cache for 10 minutes //Cache.Insert("UserMenu", sMenu, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(10)); //Store menu selected date in Cache for 10 minutes //Cache.Insert("CurrentDate", sDateNew, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(10)); } } MenuString = GlobalCode.Field2String(Session["UserMenu"]); ucLiteralMenu.Text = MenuString; }
/// <summary> /// Date Created: 27/Nov/2012 /// Created By: Josephine Gad /// (description) Get users menu by UserName using session /// ---------------------------------------------------------------- /// Date Modified: 25/Apr/2013 /// Modified By: Josephine Gad /// (description) Change Hotel Vendor's Page to HotelConfirmManifest.aspx Page /// ---------------------------------------------------------------- /// Date Modified: 7/May/2013 /// Modified By: Marco Abejar /// (description) Change Crew Assist Page to HotelDashboardRoomType5.aspx Page ///---------------------------------------------- /// Date Modified: 07/Mar/2014 /// Modified By: Josephine Gad /// (description) Change class of menu if Service Provider ///---------------------------------------------- /// </summary> private void BindMenu() { string URLString = ""; string MenuString = ""; string UserName = GlobalCode.Field2String(Session["UserName"]); //MUser.GetUserName(); string UserRole = GlobalCode.Field2String(Session["UserRole"]);; //MUser.GetUserRole(); if (Session["UserMenu"] == null) { if (Request.QueryString["ufn"] != null) { Session["DateFrom"] = Request.QueryString["dt"]; URLString = "?ufn=" + Request.QueryString["ufn"] + "&dt=" + Request.QueryString["dt"]; //gelo } MenuString = "<ul id =\"nav\">"; if (UserRole == TravelMartVariable.RoleAdministrator) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../HotelDashboardRoomType5.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleHotelSpecialist) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../HotelDashboardRoomType5.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RolePortSpecialist) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../PortAgent/PortAgentDashboard.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleMeetGreet) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../MeetAndGreet/MeetAndGreet.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleCrewAdmin) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../CrewAdmin/CrewAdmin.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleHotelVendor) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../Hotel/HotelConfirmManifest.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleSystemAnalyst) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../SystemAnalyst/ExceptionPNR.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleCrewAssist || UserRole == TravelMartVariable.RoleCrewAssistTeamLead) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../CrewAssist/CrewAssist.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleVehicleVendor) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../Vehicle/VehicleManifestByVendor.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleFinance || UserRole == TravelMartVariable.RoleCrewMedical) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../ManifestSearchFilterPage.aspx" + URLString + "\">Home</a></li>"; } else if (UserRole == TravelMartVariable.RoleImmigration) { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../Immigration/CrewVerification.aspx" + URLString + "\">Home</a></li>"; } else { MenuString += "<li><a runat=\"server\" id=\"uoAHome\" href=\"../Manifest.aspx" + URLString + "\">Home</a></li>"; } string PageUrlString = ""; string SubMenuString = ""; string SubMenuString2 = ""; try { List <UserMenus> menuList = new List <UserMenus>(); List <UserSubMenus> subMenuList = new List <UserSubMenus>(); if (Session["UserMenuList"] != null) { menuList = (List <UserMenus>)Session["UserMenuList"]; subMenuList = (List <UserSubMenus>)Session["UserSubMenuList"]; } else { menuList = UserRightsBLL.GetMenuListByUser(UserName); subMenuList = (List <UserSubMenus>)Session["UserSubMenuList"]; } if (menuList.Count > 0) { int menuMaxCount = menuList.Count; for (int i = 0; i < menuMaxCount; i++) { PageUrlString = menuList[i].PageName;//MenuRow["colPageNameVarchar"].ToString(); PageUrlString = (PageUrlString == "" ? "#" : "../" + PageUrlString + URLString); MenuString += "<li><a href=\"" + PageUrlString + "\">" + menuList[i].DisplayName + "</a>"; List <UserSubMenus> subMenuList1stLevel = new List <UserSubMenus>(); subMenuList1stLevel = (from a in subMenuList where a.ParentIDInt == menuList[i].PageIDInt select new UserSubMenus { ParentIDInt = a.ParentIDInt, PageIDInt = a.PageIDInt, ModuleName = a.ModuleName, PageName = a.PageName, DisplayName = a.DisplayName, Sequence = a.Sequence }).ToList(); subMenuList1stLevel = subMenuList1stLevel.OrderBy(a => a.Sequence).ToList(); if (subMenuList1stLevel.Count > 0) { SubMenuString = "<ul>"; for (int i1st = 0; i1st < subMenuList1stLevel.Count; i1st++) { PageUrlString = subMenuList1stLevel[i1st].PageName; PageUrlString = (PageUrlString == "" ? "#" : "../" + PageUrlString + URLString); SubMenuString += "<li><a href=\"" + PageUrlString + "\">" + subMenuList1stLevel[i1st].DisplayName + "</a>"; List <UserSubMenus> subMenuList2ndLevel = new List <UserSubMenus>(); subMenuList2ndLevel = (from a in subMenuList where a.ParentIDInt == subMenuList1stLevel[i1st].PageIDInt select new UserSubMenus { ParentIDInt = a.ParentIDInt, PageIDInt = a.PageIDInt, ModuleName = a.ModuleName, PageName = a.PageName, DisplayName = a.DisplayName, Sequence = a.Sequence }).ToList(); subMenuList2ndLevel = subMenuList2ndLevel.OrderBy(a => a.Sequence).ToList(); if (subMenuList2ndLevel.Count > 0) { SubMenuString2 = "<ul>"; for (int i2nd = 0; i2nd < subMenuList2ndLevel.Count; i2nd++) { PageUrlString = subMenuList2ndLevel[i2nd].PageName; PageUrlString = (PageUrlString == "" ? "#" : "../" + PageUrlString + URLString); SubMenuString2 += "<li><a href=\"" + PageUrlString + "\">" + subMenuList2ndLevel[i2nd].DisplayName + "</a></li>"; } SubMenuString2 += "</ul>"; SubMenuString += SubMenuString2; } SubMenuString += "</li>"; } SubMenuString += "</ul>"; MenuString += SubMenuString; } MenuString += "</li>"; } } } catch (Exception ex) { throw ex; } if ((UserRole != TravelMartVariable.RoleFinance) && (UserRole != TravelMartVariable.RoleCrewMedical) && (UserRole != TravelMartVariable.RoleImmigration)) { MenuString += "<li><a runat=\"server\" id=\"uoASearch\" href=\"../ManifestSearchFilter.aspx" + URLString + "\">Search</a></li>"; } MenuString += "</ul>"; Session["UserMenu"] = MenuString; //Store menu string in Cache for 10 minutes //Cache.Insert("UserMenu", MenuString, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(10)); } if (Session["CurrentDate"] == null) { Session["CurrentDate"] = Request.QueryString["dt"].ToString(); //Store menu string in Cache for 10 minutes //Cache.Insert("CurrentDate", Request.QueryString["dt"].ToString(), null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(10)); } if (Session["UserMenu"] != null && Session["CurrentDate"] != null) { string sMenu = Session["UserMenu"].ToString(); string sDate = Session["CurrentDate"].ToString(); if (sDate == "") { sDate = GlobalCode.Field2Date(DateTime.Now); } string sDateNew = Request.QueryString["dt"].ToString(); //sDate = sDate.Replace("_", "/"); if (!sDateNew.Contains("-")) { sDateNew = sDateNew.Replace("_", "/"); sMenu = sMenu.Replace(sDate, sDateNew); Session["UserMenu"] = sMenu; Session["CurrentDate"] = sDateNew; //Store menu string in Cache for 10 minutes //Cache.Insert("UserMenu", sMenu, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(10)); //Store menu selected date in Cache for 10 minutes //Cache.Insert("CurrentDate", sDateNew, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(10)); } } MenuString = GlobalCode.Field2String(Session["UserMenu"]); ucLiteralMenu.Text = MenuString; }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserName"] == null || GlobalCode.Field2String(Session["UserName"]) == "") { Response.Redirect("..\\Login.aspx"); } string sChangeDate = ""; Session["strPrevPage"] = Request.RawUrl; if (!IsPostBack) { uoHiddenFieldUser.Value = GlobalCode.Field2String(Session["UserName"]); uoHiddenFieldRole.Value = GlobalCode.Field2String(Session["UserRole"]); uoHiddenFieldDate.Value = Request.QueryString["dt"].ToString(); uoHiddenFieldDate.Value = uoHiddenFieldDate.Value.Replace("_", "/"); if (Request.QueryString["chDate"] != null) { sChangeDate = Request.QueryString["chDate"]; } if (sChangeDate == "1") { uoHiddenFieldPortAgentID.Value = GlobalCode.Field2Int(Session["PortAgentID"]).ToString(); } else { uoHiddenFieldPortAgentID.Value = GlobalCode.Field2Int(Request.QueryString["pid"]).ToString(); Session["PortAgentID"] = uoHiddenFieldPortAgentID.Value; } BindPortAgent(); BindNoOfDays(); BindStatus(); uoDropDownListDays.SelectedIndex = GlobalCode.GetselectedIndex(uoDropDownListDays, GlobalCode.Field2Int(Request.QueryString["Dy"])); uoDropDownListPortAgent.SelectedIndex = GlobalCode.GetselectedIndex(uoDropDownListPortAgent, GlobalCode.Field2Int(Request.QueryString["PA"])); uoDropDownListStatus.SelectedIndex = GlobalCode.GetselectedIndex(uoDropDownListStatus, GlobalCode.Field2Int(Request.QueryString["st"])); if (Request.QueryString["chDate"] != null) { sChangeDate = Request.QueryString["chDate"]; } HiddenField uoHiddenFieldPopupCalendar = (HiddenField)Master.FindControl("uoHiddenFieldPopupCalendar"); if (uoHiddenFieldPopupCalendar.Value == "1" || (sChangeDate == "1")) { uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy"); BindHotelManifest(0); } uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy"); PageAsyncTask TaskCombo = new PageAsyncTask(OnBeginComboExceptions, OnEndComboExceptions, null, "Async2", true); Page.RegisterAsyncTask(TaskCombo); } //else //{ // if (Request.QueryString["chDate"] != null) // { // sChangeDate = Request.QueryString["chDate"]; // } // HiddenField uoHiddenFieldPopupCalendar = (HiddenField)Master.FindControl("uoHiddenFieldPopupCalendar"); // if (uoHiddenFieldPopupCalendar.Value == "1" || (sChangeDate == "1")) // { // uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy"); // BindHotelManifest(0); // } // uoHiddenFieldDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy"); //} uoListViewHotelHeader.DataSource = null; uoListViewHotelHeader.DataBind(); uoListViewCancelHeader.DataSource = null; uoListViewCancelHeader.DataBind(); uoListViewCancelledVehicleHeader.DataSource = null; uoListViewCancelledVehicleHeader.DataBind(); uoListViewVehicleHeader.DataSource = null; uoListViewVehicleHeader.DataBind(); //if (uoHiddenFieldHotelConfirm.Value == "1") //{ // BindHotelManifest(1); // uoHiddenFieldHotelConfirm.Value = "0"; //} }
protected void uoButtonView_Click(object sender, EventArgs e) { //GetSFPortTravelDetails(); GetSFPortTravelDetailsWithCount(); string strLogDescription; string strFunction; //Insert log audit trail (Gabriel Oquialda - 16/02/2012) strLogDescription = "View button for port view clicked."; strFunction = "uoButtonView_Click"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); }
protected void uoSafeguardVendorList_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e) { string strLogDescription; string strFunction; int index = GlobalCode.Field2Int(e.CommandArgument); if (e.CommandName == "Delete") { MaintenanceViewBLL.DeleteVehicleVendor(index, GlobalCode.Field2String(Session["UserName"])); //Insert log audit trail (Gabriel Oquialda - 17/11/2011) strLogDescription = "Safeguard vendor branch deleted. (flagged as inactive)"; strFunction = "uoSafeguardVendorList_ItemCommand"; DateTime currentDate = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(index, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); GetSafeguardVendorList(); } else if (e.CommandName != "") { uoHiddenFieldSortBy.Value = e.CommandName; GetSafeguardVendorList(); } else { uoHiddenFieldSortBy.Value = "SortByName"; } }
/// Date Created: 17/02/2012 /// Created By: Gabriel Oquialda /// (description) Audit trail logs protected void HotelAirportLogAuditTrail() { string strLogDescription; string strFunction; //Insert log audit trail (Gabriel Oquialda - 16/02/2012) strLogDescription = "Add button for hotel airport editor clicked."; strFunction = "HotelAirportLogAuditTrail"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.UrlReferrer.AbsolutePath), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); }
private void SaveGridItems(Int32 pID) { //Page.Validate("Room"); //if (Page.IsValid) //{ Int32 ContractDetailID = 0; if ((DataTable)ViewState["Table"] != null) { DataTable dt = new DataTable(); dt = (DataTable)ViewState["Table"]; if (dt.Rows.Count > 0) { for (int i = 0; i < uoGridViewRooms.Rows.Count; i++) //Save the values one by one { string RoomType = dt.Rows[i]["Room Type"].ToString(); string dtFrom = dt.Rows[i]["Date From"].ToString(); string dtTo = dt.Rows[i]["Date To"].ToString(); string Currency = dt.Rows[i]["Currency"].ToString(); string RoomRate = dt.Rows[i]["Room Rate"].ToString(); bool TaxInclusive = Convert.ToBoolean(dt.Rows[i]["Tax Inclusive"].ToString()); string Tax = dt.Rows[i]["Tax(%)"].ToString(); Int32 Mon = Convert.ToInt32(dt.Rows[i]["Monday"].ToString()); Int32 Tues = Convert.ToInt32(dt.Rows[i]["Tuesday"].ToString()); Int32 Wed = Convert.ToInt32(dt.Rows[i]["Wednesday"].ToString()); Int32 Thurs = Convert.ToInt32(dt.Rows[i]["Thursday"].ToString()); Int32 Fri = Convert.ToInt32(dt.Rows[i]["Friday"].ToString()); Int32 Sat = Convert.ToInt32(dt.Rows[i]["Saturday"].ToString()); Int32 Sun = Convert.ToInt32(dt.Rows[i]["Sunday"].ToString()); //ContractDetailID = ContractBLL.AddSaveHotelDetailContract(pID, "", dtFrom, dtTo, RoomRate, RoomType, Mon, Tues, Wed, Thurs, Fri, Sat, Sun, // MUser.GetUserName(), TaxInclusive, Tax, Currency); if (ContractDetailID != 0) { string strLogDescription; string strFunction; //Insert log audit trail (Gabriel Oquialda - 19/03/2012) strLogDescription = "Hotel contract detail added."; strFunction = "SaveGridItems"; DateTime currentDate = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(ContractDetailID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); } } } } //} }
/// <summary> /// Date Modified: 02/02/2012 /// Modified By: Josephine Gad /// (description) Do not use GlobalCode.Field2String(Session["DateFrom"]) and use uoHiddenFieldDate from Request.QueryString["dt"] /// to avoid error in date conversion /// ======================================================== /// Date Modified: 15/03/2012 /// Modified By: Muhallidin G Wali /// (description) Replace Global Variable with Session /// ======================================================== /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { string userName = InitializeValues(); if (!IsPostBack) { if (Request.QueryString["dt"] != null) { if (Request.QueryString["dt"].ToString() != "") { uoHiddenFieldDate.Value = Request.QueryString["dt"].ToString(); uoHiddenFieldDate.Value = uoHiddenFieldDate.Value.Replace("_", "/"); } } string UserRolePrimary = UserAccountBLL.GetUserPrimaryRole(userName); string userRole = UserRolePrimary; uoHiddenFieldRole.Value = userRole; uoHiddenFieldUser.Value = userName; uoHiddenFieldUserId.Value = userName; uoHiddenFieldUserRole.Value = userRole; uoHiddenFieldSeafarerID.Value = GlobalCode.Field2String(Session["strSeafarerID"]); uoHiddenFieldSeafarerLN.Value = GlobalCode.Field2String(Session["strSeafarerLN"]); uoHiddenFieldSeafarerFN.Value = GlobalCode.Field2String(Session["strSeafarerFN"]); uoHiddenFieldRecLoc.Value = GlobalCode.Field2String(Session["strRecLoc"]); uoHiddenFieldVesselCode.Value = GlobalCode.Field2String(Session["strVesselCode"]); uoHiddenFieldVesselName.Value = GlobalCode.Field2String(Session["strVesselName"]); SetDefaultValues(); //GetTravelManifestWithCount(); //GetVessel(); //GetNationality(); //GetGender(); //GetRank(); if (User.IsInRole(TravelMartVariable.RoleAdministrator) || User.IsInRole(TravelMartVariable.RoleCrewAssist) || User.IsInRole(TravelMartVariable.RoleCrewAdmin) || User.IsInRole(TravelMartVariable.RolePortSpecialist) || User.IsInRole(TravelMartVariable.RoleHotelSpecialist)) { uoHyperLinkHotelAdd.Visible = true; } else { uoHyperLinkHotelAdd.Visible = false; } //if (userRole == TravelMartVariable.RoleHotelVendor || userRole == TravelMartVariable.RoleVehicleVendor) //{ // uoTRVessel.Visible = false; //} //else //{ // uoTRVessel.Visible = true; //} } if (uoHiddenFieldManifest.Value == "1") { GetTravelManifestWithCount(); } uoHiddenFieldManifest.Value = "0"; if (uoHiddenFieldSfID.Value == "") { string strSFID = Session["strSeafarerID"] != null ? Session["strSeafarerID"].ToString() : ""; uoHiddenFieldSfID.Value = strSFID; uoHyperLinkHotelAdd.HRef = "~/HotelRequest.aspx?sfId=" + uoHiddenFieldSfID.Value + "&trID=0&hrID=0&App=1"; } }
/// <summary> /// Author: Josephine Monteza /// Created Date: 07/Nov/2014 /// Description: Create XML excel file /// </summary> public static void CreateExcel(DataTable dtSource, string strFileName) { try { // Create XMLWriter using (XmlTextWriter xtwWriter = new XmlTextWriter(strFileName, Encoding.UTF8)) { int iColCount = (dtSource.Columns.Count - 1); //Format the output file for reading easier xtwWriter.Formatting = Formatting.Indented; // <?xml version="1.0"?> xtwWriter.WriteStartDocument(); // <?mso-application progid="Excel.Sheet"?> xtwWriter.WriteProcessingInstruction("mso-application", "progid=\"Excel.Sheet\""); // <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet >" xtwWriter.WriteStartElement("Workbook", "urn:schemas-microsoft-com:office:spreadsheet"); //Write definition of namespace xtwWriter.WriteAttributeString("xmlns", "o", null, "urn:schemas-microsoft-com:office:office"); xtwWriter.WriteAttributeString("xmlns", "x", null, "urn:schemas-microsoft-com:office:excel"); xtwWriter.WriteAttributeString("xmlns", "ss", null, "urn:schemas-microsoft-com:office:spreadsheet"); xtwWriter.WriteAttributeString("xmlns", "html", null, "http://www.w3.org/TR/REC-html40"); // <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> xtwWriter.WriteStartElement("DocumentProperties", "urn:schemas-microsoft-com:office:office"); // Write document properties xtwWriter.WriteElementString("Author", "Travelmart"); xtwWriter.WriteElementString("LastAuthor", Environment.UserName); xtwWriter.WriteElementString("Created", DateTime.Now.ToString("u") + "Z"); xtwWriter.WriteElementString("Company", "RCCL"); xtwWriter.WriteElementString("Version", "1"); // </DocumentProperties> xtwWriter.WriteEndElement(); // <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> xtwWriter.WriteStartElement("ExcelWorkbook", "urn:schemas-microsoft-com:office:excel"); // Write settings of workbook xtwWriter.WriteElementString("WindowHeight", "13170"); xtwWriter.WriteElementString("WindowWidth", "17580"); xtwWriter.WriteElementString("WindowTopX", "120"); xtwWriter.WriteElementString("WindowTopY", "60"); xtwWriter.WriteElementString("ProtectStructure", "False"); xtwWriter.WriteElementString("ProtectWindows", "False"); // </ExcelWorkbook> xtwWriter.WriteEndElement(); // <Styles> xtwWriter.WriteStartElement("Styles"); // <Style ss:ID="Default" ss:Name="Normal"> xtwWriter.WriteStartElement("Style"); xtwWriter.WriteAttributeString("ss", "ID", null, "Default"); xtwWriter.WriteAttributeString("ss", "Name", null, "Normal"); // <Alignment ss:Vertical="Bottom"/> xtwWriter.WriteStartElement("Alignment"); xtwWriter.WriteAttributeString("ss", "Vertical", null, "Bottom"); xtwWriter.WriteEndElement(); // Write null on the other properties xtwWriter.WriteElementString("Borders", null); xtwWriter.WriteElementString("Font", null); xtwWriter.WriteElementString("Interior", null); xtwWriter.WriteElementString("NumberFormat", null); xtwWriter.WriteElementString("Protection", null); // </Style> xtwWriter.WriteEndElement(); //Style for header xtwWriter.WriteStartElement("Style"); //<Style ss:ID="s62"> xtwWriter.WriteAttributeString("ss", "ID", null, "s62"); xtwWriter.WriteStartElement("Font"); // <Font ss:Bold="1"/> xtwWriter.WriteAttributeString("ss", "Bold", null, "1"); //end of font xtwWriter.WriteEndElement(); //End Style for header xtwWriter.WriteEndElement(); //Style for total summary numbers xtwWriter.WriteStartElement("Style"); //<Style ss:ID="s64"> xtwWriter.WriteAttributeString("ss", "ID", null, "s64"); xtwWriter.WriteStartElement("Alignment"); xtwWriter.WriteAttributeString("ss", "Horizontal", null, "Right"); xtwWriter.WriteAttributeString("ss", "Vertical", null, "Bottom"); xtwWriter.WriteEndElement(); //End Style for header xtwWriter.WriteEndElement(); // </Styles> xtwWriter.WriteEndElement(); // <Worksheet ss:Name="xxx"> xtwWriter.WriteStartElement("Worksheet"); xtwWriter.WriteAttributeString("ss", "Name", null, "Ok To Board in Brazil"); // <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="3" x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="60"> xtwWriter.WriteStartElement("Table"); int iRow = dtSource.Rows.Count + 15; xtwWriter.WriteAttributeString("ss", "ExpandedColumnCount", null, iColCount.ToString()); xtwWriter.WriteAttributeString("ss", "ExpandedRowCount", null, iRow.ToString()); xtwWriter.WriteAttributeString("x", "FullColumns", null, "1"); xtwWriter.WriteAttributeString("x", "FullRows", null, "1"); xtwWriter.WriteAttributeString("ss", "DefaultColumnWidth", null, "60"); //Header xtwWriter.WriteStartElement("Row"); xtwWriter.WriteAttributeString("ss", "StyleID", null, "s62"); int i = 1; int iFirstCol = 0; foreach (DataColumn Header in dtSource.Columns) { if (iFirstCol == 0) { iFirstCol = 1; } else { if (i <= iColCount) { xtwWriter.WriteStartElement("Cell"); // xxx xtwWriter.WriteStartElement("Data"); xtwWriter.WriteAttributeString("ss", "Type", null, "String"); // Write content of cell xtwWriter.WriteValue(Header.ColumnName); xtwWriter.WriteEndElement(); xtwWriter.WriteEndElement(); } i++; } } xtwWriter.WriteEndElement(); // Run through all rows of data source foreach (DataRow row in dtSource.Rows) { // <Row> xtwWriter.WriteStartElement("Row"); iFirstCol = 0; i = 1; // Run through all cell of current rows foreach (object cellValue in row.ItemArray) { if (iFirstCol == 0) { iFirstCol = 1; } else { if (i <= iColCount) { // <Cell> xtwWriter.WriteStartElement("Cell"); // <Data ss:Type="String">xxx</Data> xtwWriter.WriteStartElement("Data"); if (dtSource.Columns[i].Caption.ToUpper() == "EMPLOYEEID") { xtwWriter.WriteAttributeString("ss", "Type", null, "Number"); } else { xtwWriter.WriteAttributeString("ss", "Type", null, "String"); } // Write content of cell xtwWriter.WriteValue(GlobalCode.Field2String(cellValue)); // </Data> xtwWriter.WriteEndElement(); // </Cell> xtwWriter.WriteEndElement(); } i++; } } // </Row> xtwWriter.WriteEndElement(); } // </Table> xtwWriter.WriteEndElement(); // <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> xtwWriter.WriteStartElement("WorksheetOptions", "urn:schemas-microsoft-com:office:excel"); // Write settings of page xtwWriter.WriteStartElement("PageSetup"); xtwWriter.WriteStartElement("Header"); xtwWriter.WriteAttributeString("x", "Margin", null, "0.4921259845"); xtwWriter.WriteEndElement(); xtwWriter.WriteStartElement("Footer"); xtwWriter.WriteAttributeString("x", "Margin", null, "0.4921259845"); xtwWriter.WriteEndElement(); xtwWriter.WriteStartElement("PageMargins"); xtwWriter.WriteAttributeString("x", "Bottom", null, "0.984251969"); xtwWriter.WriteAttributeString("x", "Left", null, "0.78740157499999996"); xtwWriter.WriteAttributeString("x", "Right", null, "0.78740157499999996"); xtwWriter.WriteAttributeString("x", "Top", null, "0.984251969"); xtwWriter.WriteEndElement(); xtwWriter.WriteEndElement(); // <Selected/> xtwWriter.WriteElementString("Selected", null); // <Panes> xtwWriter.WriteStartElement("Panes"); // <Pane> xtwWriter.WriteStartElement("Pane"); // Write settings of active field xtwWriter.WriteElementString("Number", "1"); xtwWriter.WriteElementString("ActiveRow", "1"); xtwWriter.WriteElementString("ActiveCol", "1"); // </Pane> xtwWriter.WriteEndElement(); // </Panes> xtwWriter.WriteEndElement(); // <ProtectObjects>False</ProtectObjects> xtwWriter.WriteElementString("ProtectObjects", "False"); // <ProtectScenarios>False</ProtectScenarios> xtwWriter.WriteElementString("ProtectScenarios", "False"); // </WorksheetOptions> xtwWriter.WriteEndElement(); // </Worksheet> xtwWriter.WriteEndElement(); // </Workbook> xtwWriter.WriteEndElement(); // Write file on hard disk xtwWriter.Flush(); xtwWriter.Close(); //FileInfo FileName = new FileInfo(strFileName); //FileStream fs = new FileStream(FileName.FullName, FileMode.Create); //fs.Close(); } } catch (Exception ex) { throw ex; } finally { if (dtSource != null) { dtSource.Dispose(); } } }
/// <summary> /// Date Created: 07/11/2012 /// Created By: Josephine Gad /// (description) get list of calendar for room needed per day /// --------------------------------------------------------------- /// Date Modified: 04/Feb/2013 /// Modified By: Josephine Gad /// (description) Add Contract Room Count, Override, Total and Emergency room counts /// --------------------------------------------------------------- /// /// </summary> public List <CalendarRoomNeeded> GetCalendarRoomNeeded(string UserId, DateTime Date, string sDateTo, Int32 RegionID, Int32 PortID, Int32 BranchID) { Database db = ConnectionSetting.GetConnection(); // DatabaseFactory.CreateDatabase(); DbCommand dbCommand = null; DataTable Calendar = null; try { dbCommand = db.GetStoredProcCommand("uspSelectCalendarRoomCount"); db.AddInParameter(dbCommand, "@pUserId", DbType.String, UserId); db.AddInParameter(dbCommand, "@pDate", DbType.DateTime, Date); db.AddInParameter(dbCommand, "@pRegionID", DbType.Int32, RegionID); db.AddInParameter(dbCommand, "@pPortID", DbType.Int32, PortID); db.AddInParameter(dbCommand, "@pBranchID", DbType.Int32, BranchID); if (sDateTo != "") { db.AddInParameter(dbCommand, "@pDateTo", DbType.DateTime, GlobalCode.Field2Date(sDateTo)); } Calendar = db.ExecuteDataSet(dbCommand).Tables[0]; List <CalendarRoomNeeded> list = new List <CalendarRoomNeeded>(); list = (from a in Calendar.AsEnumerable() select new CalendarRoomNeeded { colDate = GlobalCode.Field2DateTime(a["colDate"]), sDate = GlobalCode.Field2String(a["sDate"]), SingleCount = GlobalCode.Field2Int(a["SingleCount"]), DoubleCount = GlobalCode.Field2Int(a["DoubleCount"]), TotalNeededRoom = GlobalCode.Field2Int(a["TotalNeededRoom"]), //ContractRoomSingle = GlobalCode.Field2Int(a["ContractRoomSingle"]), //ContractRoomDouble = GlobalCode.Field2Int(a["ContractRoomDouble"]), TotalContractRoom = GlobalCode.Field2Int(a["TotalContractRoom"]), //OverrideRoomSingle = GlobalCode.Field2Int(a["OverrideRoomSingle"]), //OverrideRoomDouble = GlobalCode.Field2Int(a["OverrideRoomDouble"]), TotalOverrideRoom = GlobalCode.Field2Int(a["TotalOverrideRoom"]), //TotalRoomsSingle = GlobalCode.Field2Int(a["TotalRoomsSingle"]), //TotalRoomDouble = GlobalCode.Field2Int(a["TotalRoomDouble"]), TotalRoom = GlobalCode.Field2Int(a["TotalRoom"]), //EmergencyRoomSingle = GlobalCode.Field2Int(a["EmergencyRoomSingle"]), //EmergencyRoomDouble = GlobalCode.Field2Int(a["EmergencyRoomDouble"]), //TotalEmergencyRoom = GlobalCode.Field2Int(a["TotalEmergencyRoom"]), }).ToList(); return(list); } catch (Exception ex) { throw ex; } finally { if (dbCommand != null) { dbCommand.Dispose(); } if (Calendar != null) { Calendar.Dispose(); } } }
/// <summary> /// Author: Josephine Gad /// Date Created: 10/Apr/2014 /// Description: Get the hotel to confirm using selected seafarers /// </summary> private void GetHotelManifestToConfirm() { DataTable dt = null; try { string[] sAddCancelArr = Request.QueryString["AddCancel"].Split(",".ToCharArray()); string[] sIDBigintArr = Request.QueryString["RecLoc"].Split(",".ToCharArray()); string[] sIDTReqArr = Request.QueryString["TReqID"].Split(",".ToCharArray()); string[] sIDTrans = Request.QueryString["TransID"].Split(",".ToCharArray()); int i = 0; int iTotal = sAddCancelArr.Count(); List <HotelManifestToConfirm> list = new List <HotelManifestToConfirm>(); HotelManifestToConfirm item = new HotelManifestToConfirm(); if (iTotal > 0) { for (i = 0; i < iTotal; i++) { item = new HotelManifestToConfirm(); item.AddCancel = GlobalCode.Field2String(sAddCancelArr[i]); item.IDBigint = GlobalCode.Field2Int(sIDBigintArr[i]); item.TReqID = GlobalCode.Field2Int(sIDTReqArr[i]); item.TransID = GlobalCode.Field2Int(sIDTrans[i]); list.Add(item); //} } if (list.Count > 0) { dt = getDataTable(list); DateTime currentDate = CommonFunctions.GetCurrentDateTime(); PortBLL = new PortAgentBLL(); PortBLL.PortAgentManifestGetConfirmHotelToAdd(dt, uoHiddenFieldUser.Value, uoHiddenFieldRole.Value, "Get Service Provider Hotel Manifest to confirm", "GetHotelToConfirm", Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now); BindListViewManifest(); BindRoomType(); } else { AlertMessage("No record to process!"); } } } catch (Exception ex) { throw ex; } finally { if (dt != null) { dt.Dispose(); } } }
protected void Page_Load(object sender, EventArgs e) { InitializeValues(); if (!IsPostBack) { //Audit Trail string strLogDescription = "Under Maintenance Viewed"; string strFunction = "Page_Load"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); //GetRoles(); ListView1.DataSource = null; ListView1.DataBind(); } }
//private void Clear() //{ // uoDropDownListVehicleType.SelectedIndex = 0; //} /// Date Created: 17/02/2012 /// Created By: Gabriel Oquialda /// (description) Audit trail logs protected void VehicleVendorBranchLogAuditTrail() { string strLogDescription = ""; string strFunction = ""; if (Request.QueryString["vmId"] != "0") { strLogDescription = "Edit linkbutton for vehicle vendor branch editor clicked."; } else { strLogDescription = "Add button for vehicle vendor branch editor clicked."; } strFunction = "VehicleVendorBranchLogAuditTrail"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.UrlReferrer.AbsolutePath), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); }
/// Date Modified: 15/03/2012 /// Modified By: Josephine Gad /// (description) Replace Global Variable with Session /// ------------------------------------------- /// Date Modified: 16/04/2012 /// Modified By: Charlene Remotigue /// (description) Move to new master page /// Initialize session values /// MOve initialization to initializevalues function /// ------------------------------------------- protected void Page_Load(object sender, EventArgs e) { InitializeValues(); if (!IsPostBack) { //Audit Trail string strLogDescription = "User Region Maintenance Viewed"; string strFunction = "Page_Load"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); GetRoles(); GetUsers("0"); //GetRegion(); BindRegionList(true); } if (uoHiddenFieldAdd.Value == "1") { //GetRegion(); } uoHiddenFieldAdd.Value = "0"; }
/// <summary> /// Modified By: Josephine Gad /// Date Modified: 20/Dec/2012 /// Description: Get Hotel list to filter /// ---------------------------------------------- /// </summary> private void GetHotelFilter() { List <HotelDTO> list = new List <HotelDTO>(); try { list = HotelBLL.GetHotelBranchByRegionPortCountry(uoHiddenFieldUser.Value, GlobalCode.Field2String(Session["Region"]), Session["Port"] == null ? "0" : Session["Port"].ToString(), "0", "0"); int iRowCount = list.Count; if (iRowCount == 1) { Session["Hotel"] = list[0].HotelIDString;//dt.Rows[0]["BranchID"].ToString(); } if (iRowCount > 0) { uoDropDownListHotel.Items.Clear(); uoDropDownListHotel.DataSource = list; uoDropDownListHotel.DataTextField = "HotelNameString"; uoDropDownListHotel.DataValueField = "HotelIDString"; uoDropDownListHotel.DataBind(); uoDropDownListHotel.Items.Insert(0, new ListItem("--Select Hotel--", "0")); uoDropDownListHotel.SelectedValue = "0"; if (GlobalCode.Field2Int(Session["Region"]) > 0) { if (uoDropDownListHotel.Items.FindByValue("-1") == null) { uoDropDownListHotel.Items.Insert(1, new ListItem("--Select ALL Hotel--", "-1")); } } else { if (uoDropDownListHotel.Items.FindByValue("-1") != null) { uoDropDownListHotel.Items.Remove(new ListItem("--Select ALL Hotel--", "-1")); } } uoDropDownListHotel.Enabled = true; if (uoDropDownListHotel.Items.FindByValue(GlobalCode.Field2String(Session["Hotel"])) != null) { uoDropDownListHotel.SelectedValue = GlobalCode.Field2String(Session["Hotel"]); } Session["Hotel"] = uoDropDownListHotel.SelectedValue; Session["HotelNameToSearch"] = uoDropDownListHotel.SelectedItem.Text; //LoadTravelDetails(); } else { uoDropDownListHotel.Enabled = false; } } catch (Exception ex) { throw ex; } }
/// <summary> /// Date Created: 11/Nov/2014 /// Created By: Josephine Monteza /// (description) Get User List with token /// --------------------------------------- /// </summary> public static List <UserList> GetUserList() { Database db = DatabaseFactory.CreateDatabase("APPSERVICESConnectionString"); DbCommand comm = null; DataSet ds = null; DataTable dt = null; List <UserList> list = new List <UserList>(); try { comm = db.GetStoredProcCommand("uspGetUsersAll"); ds = db.ExecuteDataSet(comm); if (ds.Tables.Count > 0) { dt = ds.Tables[1]; list = (from a in dt.AsEnumerable() select new UserList { sUserID = a.Field <Guid>("UserId"), sEnc = CommonFunctions.EncryptString(GlobalCode.Field2String(a["UserId"]), GlobalCode.Field2String(a["UserName"])), sDec = CommonFunctions.DecryptString(CommonFunctions.EncryptString(GlobalCode.Field2String(a["UserId"]), GlobalCode.Field2String(a["UserName"])), GlobalCode.Field2String(a["UserName"])), sUserName = a.Field <string>("UserName"), sUserEmail = a.Field <string>("Email"), sLastName = a.Field <string>("colLNameVarchar"), sFirstName = a.Field <string>("colFNameVarchar"), dDateCreated = a.Field <DateTime>("CreateDate"), }).ToList(); } return(list); } catch (Exception ex) { throw ex; } finally { if (comm != null) { comm.Dispose(); } if (ds != null) { ds.Dispose(); } if (dt != null) { dt.Dispose(); } } }
/// Date Created: 17/02/2012 /// Created By: Gabriel Oquialda /// (description) Audit trail logs protected void VehicleVendorLogAuditTrail() { string strLogDescription; string strFunction; if (Request.QueryString["vmId"].ToString() != "0") { strLogDescription = "Edit linkbutton for meet and greet vendor editor clicked."; } else { strLogDescription = "Add button for meet and greet vendor editor clicked."; } strFunction = "VehicleVendorLogAuditTrail"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); }
/// <summary> /// Date Created: 28/12/2011 /// Created By: Josephine Gad /// (description) Save Priority /// </summary> private void SavePriority() { foreach (ListViewItem item in uoHotelVendorList.Items) { string strLogDescription; string strFunction; HiddenField uoHiddenFieldBranchID = (HiddenField)item.FindControl("uoHiddenFieldBranchID"); TextBox uoTextBoxPriority = (TextBox)item.FindControl("uoTextBoxPriority"); if (uoHiddenFieldBranchID != null) { Int32 AirportHotelID = MaintenanceViewBLL.SaveHotelPriority(uoDropDownListAirport.SelectedValue, uoHiddenFieldBranchID.Value, uoTextBoxPriority.Text, uoHiddenFieldUser.Value, uoDropDownListRoomType.SelectedValue); //Insert log audit trail (Gabriel Oquialda - 14/02/2012) strLogDescription = "Hotel branch priority updated."; strFunction = "SavePriority"; DateTime currentDate = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(AirportHotelID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); } } }