Пример #1
0
        public virtual JsonResult GetCountNotifications(
            string operationNumber, DataSourceRequest request)
        {
            var client        = new GlobalModelRepository();
            var notifications = client.GetNotificationsByUser(
                IDBContext.Current.UserName,
                operationNumber,
                request,
                GlobalCommonLogic.GetOperationDetailURL(),
                GlobalCommonLogic.GetOperationDraftDetailURL());

            notifications.New  = 0;
            notifications.Read = 0;
            foreach (var item in notifications.Data)
            {
                if (item.UserRead)
                {
                    notifications.Read++;
                }
                else
                {
                    notifications.New++;
                }
            }

            notifications.Total = notifications.New;

            return(Json(notifications));
        }
Пример #2
0
        public virtual ActionResult Index(string operationNumber = null)
        {
            ViewBag.opNumber        = operationNumber;
            ViewBag.K2ViewDetailURL = GlobalCommonLogic.GetK2WorkflowViewDetailURL();

            return(View());
        }
        public virtual ActionResult Index(string operationNumber)
        {
            Logger.GetLogger().WriteDebug("WorkflowController",
                                          "Entering index method with operation number " + operationNumber);

            ViewBag.operationNumber = operationNumber;
            ViewBag.K2ViewDetailURL = GlobalCommonLogic.GetK2WorkflowViewDetailURL();
            Logger.GetLogger().WriteDebug("WorkflowController",
                                          "K2 Workflow view detail URL " + ViewBag.K2ViewDetailURL);

            ViewBag.OpDetailURL = GlobalCommonLogic.GetOperationDetailURL();
            Logger.GetLogger().WriteDebug("WorkflowController",
                                          "K2 operation detail URL " + ViewBag.OpDetailURL);

            ViewBag.lstStatus = new List <SelectListItem>();

            ViewBag.lstStatus.Add(new SelectListItem
            {
                Text  = Localization.GetText("Select Status"),
                Value = string.Empty
            });

            Logger.GetLogger().WriteDebug("WorkflowController", "Going to get workflow status");

            foreach (string st in _workflowModelRepository.GetWorkFlowStatus())
            {
                ViewBag.lstStatus.Add(new SelectListItem {
                    Text = st, Value = st
                });
            }

            ViewBag.lstTypes = new List <SelectListItem>();

            ViewBag.lstTypes.Add(new SelectListItem {
                Text = Localization.GetText("Select Workflow Type"), Value = string.Empty
            });

            Logger.GetLogger().WriteDebug("WorkflowController", "Going to get workflow types");
            foreach (var workflowType in _workflowModelRepository.GetWorkFlowTypes())
            {
                ViewBag.lstTypes.Add(new SelectListItem
                {
                    Text  = workflowType.Name,
                    Value = workflowType.WorkflowTypeId.ToString()
                });
            }

            Logger.GetLogger().WriteDebug("WorkflowController", "Going to compare the user");
            ViewBag.userName = string.IsNullOrEmpty(operationNumber) ? IDBContext.Current.UserName : null;

            Logger.GetLogger().WriteDebug("WorkflowController", "Returning ...");
            return(View());
        }
Пример #4
0
        public virtual ActionResult IndexDataGrid(DataSourceRequest request)
        {
            var authorizationManagerClient = Globals.Resolve <IAuthorizationManager>();
            var roles        = authorizationManagerClient.GetRoles(IDBContext.Current.UserLoginName, string.Empty);
            var userIsGlobal = _operationService.IsRoleTypeGlobal(roles);

            if (userIsGlobal)
            {
                return(View(new OperationViewModel()));
            }

            var commonLogin = new GlobalCommonLogic();
            var viewModel   = commonLogin.GetMyOperations(request);

            ViewBag.TotalOperations = 0;
            ViewBag.OpDetailURL     = Url.Action("Operation", "Mainframe"); //GlobalCommonLogic.GetOperationDetailURL();
            return(View(viewModel));
        }
Пример #5
0
        public virtual JsonResult GetData(string operationNumber, DataSourceRequest request)
        {
            var client = new GlobalModelRepository();
            var viewM  = client.GetNotificationsByUser(
                IDBContext.Current.UserName,
                operationNumber,
                request,
                GlobalCommonLogic.GetOperationDetailURL(),
                GlobalCommonLogic.GetOperationDraftDetailURL());

            string lang = IDBContext.Current.CurrentLanguage;

            foreach (var item in viewM.Data)
            {
                item.Subject = GlobalCommonLogic.BuildNotification(item.Body, "SUBJECT", lang);
                item.Body    = GlobalCommonLogic.BuildNotification(item.Body, "BODY", lang);
            }

            return(Json(viewM));
        }
Пример #6
0
        public virtual ActionResult Index()
        {
            var authorizationManagerClient = Globals.Resolve <IAuthorizationManager>();
            var roles        = authorizationManagerClient.GetRoles(IDBContext.Current.UserLoginName, string.Empty);
            var userIsGlobal = _operationService.IsRoleTypeGlobal(roles);

            var commonLogin = new GlobalCommonLogic();
            var model       = new OperationsViewModel();

            ViewBag.TotalOperations = 0;
            ViewBag.OpDetailURL     = Url.Action("Operation", "Mainframe"); //GlobalCommonLogic.GetOperationDetailURL();
            model.LastViewed        = commonLogin.GetOperationsLastViewed();

            if (userIsGlobal)
            {
                model.IsGlobal = true;
                return(View(model));
            }

            model.IsGlobal = false;
            return(View(model));
        }