Ejemplo n.º 1
0
        public ActionResult AuditSetup()
        {
            objLoginHelper = (LoginHelper)Session["LogInInformation"];

            PageAccessRightHelper objPageAccessRightHelper = new PageAccessRightHelper();

            objPageAccessRightHelper = securityDal.ReadPageAccessRight(Helper.ForAuditor, "AuditSetup", objLoginHelper.UerRoleOrGroupID, Helper.Inactive);
            if (objPageAccessRightHelper != null)
            {
                if (objPageAccessRightHelper.AccessStatus == Helper.Inactive)
                {
                    Session["messageInformation"] = objPageAccessRightHelper.MessageToShow;
                    return(RedirectToAction("ErrorMessage", "ErrorHnadle"));
                }
            }

            ViewBag.LocationTitle = objLoginHelper.LocationTitle;
            ViewBag.Location      = objLoginHelper.Location;
            ViewBag.ZoneTitle     = objLoginHelper.ZoneTitle;
            ViewBag.ZoneName      = objLoginHelper.LogInForZoneName;
            ViewBag.RegionTitle   = objLoginHelper.RegionTitle;
            ViewBag.RegionName    = objLoginHelper.LogInForRegionName;
            ViewBag.UnitTitle     = objLoginHelper.UnitTitle;
            ViewBag.UnitName      = objLoginHelper.LogInForUnitName;

            ViewBag.OpenEndDay   = Helper.MonthStartDate(objLoginHelper.TransactionOpenDate.Date.ToString("yyyyMM")).ToString("dd-MMM-yyyy");
            ViewBag.OpenStartDay = Helper.MonthEndDate(objLoginHelper.TransactionBackDate.Date.ToString("yyyyMM")).ToString("dd-MMM-yyyy");

            ViewBag.DayOpenningDate = objLoginHelper.TransactionOpenDate.ToString("dd-MMM-yyyy");
            ViewBag.OpenMonthYear   = objLoginHelper.TransactionOpenDate.ToString("MMMM  dd, yyyy");

            ViewBag.ModuleName = objLoginHelper.ModluleTitle;
            ViewBag.TopMenu    = objLoginHelper.TopMenu;

            string auditNumberMax         = inventoryDal.AuditSequenceNumberMax(objLoginHelper.LocationCode, objLoginHelper.TransactionOpenDate.ToString("yyMMdd"));
            string auditSequenceNumberNew = Helper.ChallanCequenceNumberGeneration(auditNumberMax, objLoginHelper);

            ViewBag.Employee = hrmsData.AuditorEmployeeList();

            AuditingMaster auditingMaster = new AuditingMaster();

            auditingMaster = hrmsData.AuditMasterCheckNGetAuditMasterDetails(objLoginHelper.LocationCode, objLoginHelper.TransactionOpenDate.Date);

            if (string.IsNullOrEmpty(auditingMaster.AuditSeqNo))
            {
                ViewBag.EditPermission = true;
            }
            else
            {
                ViewBag.EditPermission = false;
            }

            auditingMaster.AuditSeqNo = string.IsNullOrEmpty(auditingMaster.AuditSeqNo) ? auditingMaster.AuditSeqNo = auditSequenceNumberNew : auditingMaster.AuditSeqNo;

            return(View(auditingMaster));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Check if the page is accessible for the current user.
        /// </summary>
        /// <param name="moduleId">The page is for what module. ie. SAL for Sales, AUD for audit, INV for Inventory</param>
        /// <param name="pageNameToLink">WHich Action is responsible for this page. ie. Action method Name</param>
        /// <param name="roleOrGroupId">User Role/Group ID</param>
        /// <param name="accessRightStatus">Ture for Access & False For UnAccess</param>
        /// <param name="message">The Message you want to show. It is Default. If page is not accessible the a error message is throw</param>
        /// <returns>Ture for Access & False For UnAccess</returns>
        public bool IsPageAccessible(string moduleId, string pageNameToLink, string roleOrGroupId, byte accessRightStatus, out string message)
        {
            bool accessibleOrNot = true;

            message = string.Empty;

            PageAccessRightHelper objPageAccessRightHelper = new PageAccessRightHelper();

            objPageAccessRightHelper = securityService.ReadPageAccessRight(moduleId, pageNameToLink, roleOrGroupId, accessRightStatus);
            if (objPageAccessRightHelper != null)
            {
                if (objPageAccessRightHelper.AccessStatus == Helper.Inactive)
                {
                    accessibleOrNot = false;
                    message         = objPageAccessRightHelper.MessageToShow;
                }
            }

            return(accessibleOrNot);
        }