Esempio n. 1
0
        /// <summary>
        /// Author:         Josephine Monteza
        /// Date Created:   03/Oct/2017
        /// Descrption:     Get Vendor list of Driver
        /// =============================================================
        /// </summary>
        public List <VehicleVendorDTO> GetDriverVendorList(string sLoginUser, string sUserID, string sVendorToFind, bool bIsToBeAdded, string sVendorType,
                                                           int iStartRow, int iMaxRow, Int16 iLoadType, string sOrderBy, string sToLoad)
        {
            string sToFind = sVendorToFind == null ? "" : sVendorToFind;

            if (iLoadType == 0 || sToLoad == "VehicleToAdd")
            {
                UserVendorBLL.DriverVendorGet(sLoginUser, sUserID, sToFind, bIsToBeAdded, sVendorType,
                                              iStartRow, iMaxRow, iLoadType, sOrderBy);
            }


            List <VehicleVendorDTO> listVehicleVendorToAdd = new List <VehicleVendorDTO>();

            if (sVendorType == "Vehicle")
            {
                if (bIsToBeAdded)
                {
                    if (Session["User_VehicleVendorToAdd"] != null)
                    {
                        listVehicleVendorToAdd = (List <VehicleVendorDTO>)Session["User_VehicleVendorToAdd"];
                    }
                }
            }
            return(listVehicleVendorToAdd);
        }
Esempio n. 2
0
        //private void BindListViewVehicleNotInUser(bool IsNew, bool IsFromSearch)
        //{
        //    List<VehicleVendorDTO> list = GetVehicleVendorNotInUser(IsNew, IsFromSearch);
        //    uoListViewVehicle.DataSource = list;
        //    uoListViewVehicle.DataBind();
        //}
        //private void BindListViewSeaportInUser(bool IsNew)
        //{
        //    List<VehicleVendorDTO> list = GetVehicleVendorInUser(IsNew);
        //    uoListViewVehicleSaved.DataSource = list;
        //    uoListViewVehicleSaved.DataBind();
        //}
        /// <summary>
        /// Date Created:   03/Oct/2017
        /// Created By:     Josephine Monteza
        /// (description)   Get Vehicle Vendor not in user's access
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        //private List<VehicleVendorDTO> GetVehicleVendorNotInUser(bool IsNew, bool IsFromSearch)
        //{
        //    List<VehicleVendorDTO> list = new List<VehicleVendorDTO>();
        //    List<VehicleVendorDTO> listAdded = new List<VehicleVendorDTO>();


        //    if (IsNew)
        //    {
        //        list = UserVendorBLL.GetUserVehicleVendor(uoHiddenFieldUser.Value, uoTextBoxVehicleSearch.Text.Trim(), true);
        //    }
        //    else
        //    {
        //        if (Session["User_VehicleVendorToAdd"] == null)
        //        {
        //            list = UserVendorBLL.GetUserVehicleVendor(uoHiddenFieldUser.Value, uoTextBoxVehicleSearch.Text.Trim(), true);
        //        }
        //        else
        //        {
        //            list = (List<VehicleVendorDTO>)Session["User_VehicleVendorToAdd"];
        //        }
        //    }

        //    if (IsFromSearch)
        //    {
        //        listAdded = GetVehicleVendorInUser(false);
        //    }
        //    else
        //    {
        //        listAdded = GetVehicleVendorInUser(IsNew);
        //    }
        //    list.RemoveAll(a => listAdded.Exists(b => a.VehicleName == b.VehicleName));
        //    list = list.OrderBy(a => a.VehicleName).ToList();

        //    Session["User_VehicleVendorToAdd"] = list;
        //    return list;
        //}
        /// <summary>
        /// Date Created:   03/Oct/2017
        /// Created By:     Josephine Monteza
        /// (description)   Get Vehicle Vendor in user's access
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        private List <VehicleVendorDTO> GetVehicleVendorInUser(bool IsNew)
        {
            List <VehicleVendorDTO> list = new List <VehicleVendorDTO>();

            if (IsNew)
            {
                UserVendorBLL.GreeterVendorGet(uoHiddenFieldUserName.Value, uoHiddenFieldUser.Value, "", false, "Vehicle", 0,
                                               uoPagerVehicleSaved.TotalRowCount, 1, uoHiddenFieldSortBy.Value);
                list = (List <VehicleVendorDTO>)Session["User_VehicleVendorAdded"];
            }
            else
            {
                if (Session["User_VehicleVendorAdded"] == null)
                {
                    UserVendorBLL.GreeterVendorGet(uoHiddenFieldUserName.Value, uoHiddenFieldUser.Value, "", false, "Vehicle", 0,
                                                   uoPagerVehicleSaved.TotalRowCount, 1, uoHiddenFieldSortBy.Value);
                    list = (List <VehicleVendorDTO>)Session["User_VehicleVendorAdded"];
                }
                else
                {
                    list = (List <VehicleVendorDTO>)Session["User_VehicleVendorAdded"];
                }
            }
            list = list.OrderBy(a => a.VehicleName).ToList();
            Session["User_VehicleVendorAdded"] = list;
            return(list);
        }
Esempio n. 3
0
        /// <summary>
        /// Author:         Josephine Monteza
        /// Date Created:   03/Oct/2017
        /// Descrption:     Get Vendor list of Driver
        /// =============================================================
        /// </summary>
        public List <VehicleVendorDTO> GetDriverVehicleVendorAddedList(string sLoginUser, string sUserID, string sVendorToFind, bool bIsToBeAdded, string sVendorType,
                                                                       int iStartRow, int iMaxRow, Int16 iLoadType, string sOrderBy, string sToLoad)
        {
            List <VehicleVendorDTO> listVehicleVendorAdded = new List <VehicleVendorDTO>();

            string sToFind = "";

            if (iLoadType == 1 || sToLoad == "VehicleAdded")
            {
                UserVendorBLL.DriverVendorGet(sLoginUser, sUserID, sToFind, bIsToBeAdded, sVendorType,
                                              iStartRow, iMaxRow, iLoadType, sOrderBy);
            }

            if (Session["User_VehicleVendorAdded"] != null)
            {
                listVehicleVendorAdded = (List <VehicleVendorDTO>)Session["User_VehicleVendorAdded"];
            }
            return(listVehicleVendorAdded);
        }
Esempio n. 4
0
        /// <summary>
        /// Date Created:   03/Oct/2017
        /// Created By:     Josephine Monteza
        /// (description)   Remove vehicle Vendor from right to left
        /// </summary>
        private void RemoveVehicleVendor()
        {
            CheckBox    uoCheckBoxSelect;
            HiddenField uoHiddenFieldVehicleVendor;

            using (DataTable dtVendor = new DataTable())
            {
                dtVendor.Columns.Add("UserName", typeof(string));
                dtVendor.Columns.Add("VendorID", typeof(Int64));
                DataRow dRow;

                foreach (ListViewItem item in uoListViewVehicleSaved.Items)
                {
                    uoCheckBoxSelect = (CheckBox)item.FindControl("uoCheckBoxSelect");
                    if (uoCheckBoxSelect.Checked == true)
                    {
                        uoHiddenFieldVehicleVendor = (HiddenField)item.FindControl("uoHiddenFieldVehicleVendor");

                        dRow             = dtVendor.NewRow();
                        dRow["UserName"] = uoHiddenFieldUser.Value;
                        dRow["VendorID"] = GlobalCode.Field2Long(uoHiddenFieldVehicleVendor.Value);
                        dtVendor.Rows.Add(dRow);
                    }
                }
                if (dtVendor.Rows.Count > 0)
                {
                    DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                    UserVendorBLL.DriverVendorAddEdit(uoHiddenFieldUser.Value, false, dtVendor,
                                                      "Vehicle", "Remove Driver Vehicle Vendor assignment", "RemoveVehicleVendor",
                                                      Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate),
                                                      uoHiddenFieldUserName.Value);
                }
            }
            uoHiddenFieldLoadType.Value = "0";
            uoHiddenFieldToLoad.Value   = "VehicleAdded";

            uoListViewVehicle.DataBind();
            uoListViewVehicleSaved.DataBind();
        }
Esempio n. 5
0
        /// <summary>
        /// Date Created:   25/09/2012
        /// Created By:     Josephine Gad
        /// (description)   Get Seaport in user's access
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        private List <PortAgentDTO> GetPortAgentInUser(bool IsNew)
        {
            List <PortAgentDTO> list = new List <PortAgentDTO>();

            if (IsNew)
            {
                list = UserVendorBLL.GetUserPortAgent(uoHiddenFieldUser.Value, "", false);
            }
            else
            {
                if (Session["PortAgentListInUser"] == null)
                {
                    list = UserVendorBLL.GetUserPortAgent(uoHiddenFieldUser.Value, "", false);
                }
                else
                {
                    list = (List <PortAgentDTO>)Session["PortAgentListInUser"];
                }
            }
            list = list.OrderBy(a => a.PortAgentName).ToList();
            Session["PortAgentListInUser"] = list;
            return(list);
        }
Esempio n. 6
0
        /// <summary>
        /// Date Created:   25/09/2012
        /// Created By:     Josephine Gad
        /// (description)   Get Seaport in user's access
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        private List <VehicleVendorDTO> GetVehicleVendorInUser(bool IsNew)
        {
            List <VehicleVendorDTO> list = new List <VehicleVendorDTO>();

            if (IsNew)
            {
                list = UserVendorBLL.GetUserVehicleVendor(uoHiddenFieldUser.Value, "", false);
            }
            else
            {
                if (Session["VehicleListInUser"] == null)
                {
                    list = UserVendorBLL.GetUserVehicleVendor(uoHiddenFieldUser.Value, "", false);
                }
                else
                {
                    list = (List <VehicleVendorDTO>)Session["VehicleListInUser"];
                }
            }
            list = list.OrderBy(a => a.VehicleName).ToList();
            Session["VehicleListInUser"] = list;
            return(list);
        }
Esempio n. 7
0
        /// <summary>
        /// Date Created:   04/Mar/2014
        /// Created By:     Josephine Gad
        /// Description:    Save User Service Provider
        /// </summary>
        private void SaveUserPortAgent()
        {
            DataTable   dt = null;
            HiddenField uoHiddenFieldPortAgent;

            List <UserPortAgentList> list = new List <UserPortAgentList>();

            try
            {
                foreach (ListViewItem item in uoListViewPortAgentSaved.Items)
                {
                    uoHiddenFieldPortAgent = (HiddenField)item.FindControl("uoHiddenFieldPortAgent");

                    UserPortAgentList PortAgentItem = new UserPortAgentList();
                    PortAgentItem.PortAgentID = GlobalCode.Field2Int(uoHiddenFieldPortAgent.Value);
                    PortAgentItem.UserName    = uoHiddenFieldUser.Value;
                    list.Add(PortAgentItem);
                }
                string strLogDescription = "Service Provider of User added";
                string strFunction       = "SaveUserSeaport";

                dt = getDataTable(list);
                UserVendorBLL.SaveUserPortAgent(dt, uoHiddenFieldUserName.Value, strLogDescription, strFunction, Path.GetFileName(Request.Path));
                AlertMessage("User Service Provider successfully saved.");
            }
            catch (Exception ex)
            {
                AlertMessage(ex.Message);
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Date Created:   04/Mar/2014
        /// Created By:     Josephine Gad
        /// (description)   Get Service Provider not in user's access
        /// </summary>
        /// <param name="IsNew"></param>
        /// <returns></returns>
        private List <PortAgentDTO> GetPortAgentNotInUser(bool IsNew, bool IsFromSearch)
        {
            List <PortAgentDTO> list      = new List <PortAgentDTO>();
            List <PortAgentDTO> listAdded = new List <PortAgentDTO>();


            if (IsNew)
            {
                list = UserVendorBLL.GetUserPortAgent(uoHiddenFieldUser.Value, uoTextBoxSearch.Text.Trim(), true);
            }
            else
            {
                if (Session["PortAgentListNotInUser"] == null)
                {
                    list = UserVendorBLL.GetUserPortAgent(uoHiddenFieldUser.Value, uoTextBoxSearch.Text.Trim(), true);
                }
                else
                {
                    list = (List <PortAgentDTO>)Session["PortAgentListNotInUser"];
                }
            }

            if (IsFromSearch)
            {
                listAdded = GetPortAgentInUser(false);
            }
            else
            {
                listAdded = GetPortAgentInUser(IsNew);
            }
            list.RemoveAll(a => listAdded.Exists(b => a.PortAgentName == b.PortAgentName));
            list = list.OrderBy(a => a.PortAgentName).ToList();

            Session["PortAgentListNotInUser"] = list;
            return(list);
        }
Esempio n. 9
0
        /// <summary>
        /// Date Modified:  16/03/2012
        /// Modified By:    Charlene Remotigue
        /// (description)   Use Global Code for parsing and casting
        /// -------------------------------------------
        /// Date Modified:  15/08/2012
        /// Modified By:    Josphine Gad
        /// (description)   Add different role's page
        ///----------------------------------------------
        /// Date Modified:  16/08/2012
        /// Modified By:    Jefferson Bermundo
        /// (description)   Add HotelVendor page
        ///                 Set UserBranchId upon Login
        ///----------------------------------------------
        /// Date Modified:  23/10/2012
        /// Modified By:    Josephine Gad
        /// (description)   Change UserAccountBLL.GetUserPrimaryRole(sUser) to list
        ///----------------------------------------------
        /// Date Modified:  27/Nov/2012
        /// Modified By:    Josephine Gad
        /// (description)   Add   List<UserPrimaryDetails> instead of calling different proc in DB
        ///----------------------------------------------
        /// 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:  11/Aug/2014
        /// Modified By:    Josephine Gad
        /// (description)   Add default page of Crew Medical Role
        /// ===================================
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //try
            //{
            AlertMessage("Logged already");
            AlertMessage(GlobalCode.Field2String(User.Identity.Name));



            //UserVendorBLL bll = new UserVendorBLL();
            if (GlobalCode.Field2Int(UserVendorBLL.GetActiveUserVendor(User.Identity.Name)) == 0)
            {
                Session["ActiveUserVendor"] = 1;
                Response.Redirect("Login.aspx");

                //AlertMessage("There is no active contract connected in your account.");
            }

            if (User.Identity.Name == "")
            {
                Response.Redirect("Login.aspx", false);
            }
            MembershipUser mUser = Membership.GetUser(User.Identity.Name);

            mUser.UnlockUser();
            //if (mUser.CreationDate.Equals(mUser.LastPasswordChangedDate))
            //{
            //    Response.Redirect("~/LoginReset.aspx", false);
            //}
            //else
            {
                string strLogDescription;
                string strFunction;

                string[] uRoles = Roles.GetRolesForUser(mUser.UserName);

                if (uRoles[0] != "")
                {
                    string sUser = mUser.UserName;
                    List <UserAccountList> userAccount = UserAccountBLL.GetUserInfoListByName(sUser);
                    Session["UserAccountList"] = userAccount;

                    List <UserPrimaryDetails> userDetails = (List <UserPrimaryDetails>)Session["UserPrimaryDetails"];

                    var vRole = (from a in userAccount
                                 where a.bIsPrimary == true
                                 select new
                    {
                        sRole = a.sRole
                    }).ToList();                      //UserAccountBLL.GetUserPrimaryRole(sUser);
                    string PrimaryRole  = vRole[0].sRole;
                    string strUserFName = userDetails[0].sFirstName + " as " + PrimaryRole;
                    //UserAccountBLL.GetUserFirstname(mUser.ToString()) + " as " + PrimaryRole;

                    DateTime dDateFrom = CommonFunctions.GetCurrentDateTime();
                    Session["UserName"] = sUser;
                    Session["UserRole"] = PrimaryRole;
                    Session["DateFrom"] = dDateFrom.ToString("MM/dd/yyyy");

                    //add UserBranchId Upon LogIn
                    Session["UserBranchID"] = userDetails[0].iBranchID;   //UserAccountBLL.GetUserBranchId(sUser, PrimaryRole);
                    Session["BranchName"]   = userDetails[0].sBranchName; //UserAccountBLL.GetUserBranchName(sUser, PrimaryRole);
                    Session["VendorID"]     = userDetails[0].iVendorID;   // UserAccountBLL.GetUserVendorId(sUser, PrimaryRole);

                    FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
                                                                                     sUser, dDateFrom, dDateFrom.AddMinutes(90), false, PrimaryRole, FormsAuthentication.FormsCookiePath);

                    //Insert log audit trail (Gabriel Oquialda - 16/02/2012)
                    strLogDescription = "User logged as " + PrimaryRole + ".";
                    strFunction       = "Page_Load";

                    DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                    BLL.AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                          CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, sUser);

                    if (PrimaryRole == TravelMartVariable.RoleAdministrator)
                    {
                        Response.Redirect("~/HotelDashboardRoomType5.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleHotelSpecialist)
                    {
                        //Response.Redirect("~/HotelDashboardRoomType.aspx?ufn=" + strUserFName);
                        Response.Redirect("~/HotelDashboardRoomType5.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RolePortSpecialist)
                    {
                        Response.Redirect("~/PortAgent/PortAgentDashboardNew.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleMeetGreet)
                    {
                        Response.Redirect("~/MeetAndGreet/MeetAndGreet.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleCrewAdmin)
                    {
                        Response.Redirect("~/CrewAdmin/CrewAdmin.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleHotelVendor)
                    {
                        //Response.Redirect("~/Hotel/HotelVendor.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                        Response.Redirect("~/Hotel/HotelConfirmManifest.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleSystemAnalyst)
                    {
                        Response.Redirect("~/SystemAnalyst/ExceptionPNR.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleFinance)
                    {
                        Response.Redirect("~/ManifestSearchFilterPage.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleImmigration)
                    {
                        Response.Redirect("~/Immigration/CrewVerification.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleCrewAssist)
                    {
                        Response.Redirect("~/CrewAssist/CrewAssist.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                        //Response.Redirect("~/CrewAssist/CrewAssistNew.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleCrewAssistTeamLead)
                    {
                        Response.Redirect("~/CrewAssist/CrewAssist.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                        //Response.Redirect("~/Medical/Medical.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleVehicleVendor)
                    {
                        Response.Redirect("~/Vehicle/VehicleManifestByVendor.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleCrewMedical)
                    {
                        Response.Redirect("~/ManifestSearchFilterPage.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }

                    else if (PrimaryRole == TravelMartVariable.RoleCrewMedical)
                    {
                        Response.Redirect("~/ManifestSearchFilterPage.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleDriver)
                    {
                        Response.Redirect("~/Vehicle/VehicleManifestByVendor.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    else if (PrimaryRole == TravelMartVariable.RoleGreeter)
                    {
                        Response.Redirect("~/Vehicle/VehicleManifestByVendor.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy"));
                    }
                    //else
                    //{
                    //    Response.Redirect("~/Manifest.aspx?ufn=" + strUserFName + "&dt=" + DateTime.Now.ToString("MM/dd/yyyy")); //gelo
                    //}
                }
                else
                {
                    Response.Redirect("~/Login.aspx", false);
                }
            }
            //}
            //catch (Exception ex)
            //{
            //    ExceptionBLL.InsertException(ex.Message, "LoginProcess.aspx", CommonFunctions.GetCurrentDateTime(), Session["UserName"].ToString());
            //}
        }