Ejemplo n.º 1
0
        public ActionResult TripReasonView()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.TripReason);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                if (!objPermission.View_Right)
                {
                    return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                }
                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                this.ViewData["blAddRights"]    = objPermission.Add_Right;
                this.ViewData["blEditRights"]   = objPermission.Edit_Right;
                this.ViewData["blDeleteRights"] = objPermission.Delete_Right;
                this.ViewData["blExportRights"] = objPermission.Export_Right;

                return(this.View());
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.TripReason, mySession.Current.UserId);
                return(this.View());
            }
        }
Ejemplo n.º 2
0
        public ActionResult TrackerFormattedPrint()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.Tracker);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                this.ViewData["UserName"]   = mySession.Current.UserName;
                this.ViewData["UserRoleID"] = mySession.Current.RoleId;
                this.ViewData["lstCar"]     = this.objiClsCarFleet.GetAllCarFleetForDropDown().ToList();
                return(this.View());
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Tracker, mySession.Current.UserId);
                return(this.View());
            }
        }
        public override void OnActionExecuting(ActionExecutingContext actionContext)
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission((long)_page);

                if (!objPermission.IsActive)
                {
                    actionContext.Result = new RedirectToRouteResult("Logout", null);
                }

                if (!objPermission.View_Right)
                {
                    actionContext.Result = new RedirectToRouteResult("PermissionRedirectPage", null);
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                actionContext.Controller.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                actionContext.Controller.ViewData["blAddRights"]    = objPermission.Add_Right;
                actionContext.Controller.ViewData["blEditRights"]   = objPermission.Edit_Right;
                actionContext.Controller.ViewData["blDeleteRights"] = objPermission.Delete_Right;
                actionContext.Controller.ViewData["blExportRights"] = objPermission.Export_Right;
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.AdditionalCost, mySession.Current.UserId);
            }
        }
Ejemplo n.º 4
0
        public ActionResult CarFleet()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.CarFleet);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                ClsCarFleet objClsCarFleet = this.objiClsCarFleet as ClsCarFleet;
                long        lgCarFleetId   = 0;
                if (this.Request.QueryString.Count > 0)
                {
                    if (this.Request.QueryString["iFrame"] != null)
                    {
                        if (!objPermission.Add_Right)
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        objClsCarFleet.hdniFrame = true;
                        this.ViewData["iFrame"]  = "iFrame";
                    }
                    else
                    {
                        if (!objPermission.Edit_Right || string.IsNullOrEmpty(this.Request.QueryString.ToString().Decode()))
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        lgCarFleetId   = this.Request.QueryString.ToString().Decode().longSafe();
                        objClsCarFleet = this.objiClsCarFleet.GetCarFleetByCarFleetId(lgCarFleetId);
                    }
                }
                else
                {
                    if (!objPermission.Add_Right)
                    {
                        return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                    }
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                this.BindDropDownListForCarFleet(objClsCarFleet, true);

                return(this.View(objClsCarFleet));
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.CarFleet, mySession.Current.UserId);
                return(this.View());
            }
        }
Ejemplo n.º 5
0
        public ActionResult Tracker(ClsTracker objTracker)
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.Tracker);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                if (objTracker.inId == 0)
                {
                    if (!objPermission.Add_Right)
                    {
                        return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                    }
                }
                else
                {
                    if (!objPermission.Edit_Right)
                    {
                        return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                    }
                }

                if (objTracker.hdniFrame)
                {
                    this.ViewData["iFrame"] = "iFrame";
                }

                string strErrorMsg = this.ValidateTracker(objTracker);
                if (!string.IsNullOrEmpty(strErrorMsg))
                {
                    this.ViewData["Success"] = "0";
                    this.ViewData["Message"] = strErrorMsg;
                }
                else
                {
                    var carFleet = objiClsCarFleet.GetCarFleetByCarFleetId((long)objTracker.inCarId);
                    objTracker.inId = this.objiClsTracker.SaveTracker(objTracker, carFleet);
                    if (objTracker.inId > 0)
                    {
                        this.ViewData["Success"] = "1";
                        this.ViewData["Message"] = Functions.AlertMessage("Tracker", MessageType.Success);
                        this.BindDropDownListForTracker(objTracker, true);
                        return(this.View(objTracker));
                    }
                    else
                    {
                        this.ViewData["Success"] = "0";
                        this.ViewData["Message"] = Functions.AlertMessage("Tracker", MessageType.Fail);
                    }
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                this.ViewData["UserRoleID"] = mySession.Current.RoleId;
                this.BindDropDownListForTracker(objTracker, true);
                return(this.View(objTracker));
            }
            catch (Exception ex)
            {
                this.ViewData["Success"] = "0";
                this.ViewData["Message"] = Functions.AlertMessage("Tracker", MessageType.Fail);
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Tracker, mySession.Current.UserId);
                return(this.View(objTracker));
            }
        }
Ejemplo n.º 6
0
        public ActionResult Tracker()
        {
            try
            {
                GetPagePermissionResult objPermission = Functions.CheckPagePermission(PageMaster.Tracker);
                if (!objPermission.IsActive)
                {
                    return(this.RedirectToAction("Logout", "Home"));
                }

                ClsTracker objClsTracker = this.objiClsTracker as ClsTracker;
                long       lgTrackerId   = 0;
                if (this.Request.QueryString.Count > 0)
                {
                    if (this.Request.QueryString["iFrame"] != null)
                    {
                        if (!objPermission.Add_Right)
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        objClsTracker.hdniFrame = true;
                        this.ViewData["iFrame"] = "iFrame";
                    }
                    else
                    {
                        if (!objPermission.Edit_Right || string.IsNullOrEmpty(this.Request.QueryString.ToString().Decode()))
                        {
                            return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                        }

                        lgTrackerId            = this.Request.QueryString.ToString().Decode().longSafe();
                        objClsTracker          = this.objiClsTracker.GetTrackerByTrackerId(lgTrackerId);
                        objClsTracker.inCodeId = objClsTracker.inCarId;
                        objClsTracker.inCarIdForRegistration = objClsTracker.inCarId;
                    }
                }
                else
                {
                    objClsTracker.strEntryDatetime = DateTime.Now.ToString("dd/MM/yyyy");
                    objClsTracker.strEntryMethod   = "W";
                    objClsTracker.blActive         = true;
                    if (!objPermission.Add_Right)
                    {
                        return(this.RedirectToAction("PermissionRedirectPage", "Home"));
                    }
                }

                #region Menu Access
                Controllers.BaseController baseController = new Controllers.BaseController();
                this.ViewData = baseController.MenuAccessPermissions(objPermission);
                #endregion Menu Access

                this.ViewData["UserRoleID"] = mySession.Current.RoleId;

                this.BindDropDownListForTracker(objClsTracker, true);
                return(this.View(objClsTracker));
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.Tracker, mySession.Current.UserId);
                return(this.View());
            }
        }