Exemplo n.º 1
0
        public ViewResult EditActive(int activeId)
        {
            var service = new ActiveService();
            var active  = service.GetById(activeId);

            return(View("_EditActive", active));
        }
Exemplo n.º 2
0
        public PartialViewResult ReOrderActiveStep(int orderId, string type, int activeId)
        {
            var service = new ActiveService();
            var tempId  = 0;

            if (type == "DOWN")
            {
                tempId = orderId + 1;
            }
            else if (type == "UP")
            {
                tempId = orderId - 1;
            }
            var active = service.GetById(activeId);

            foreach (var s in active.Steps)
            {
                if (s.OrderId == tempId)
                {
                    s.OrderId = orderId;
                }
                else if (s.OrderId == orderId)
                {
                    s.OrderId = tempId;
                }
            }
            active.Steps.Sort();
            service.UpdateSteps(activeId, active.Steps);
            return(PartialView("_ActiveSteps", active));
        }
Exemplo n.º 3
0
        public JsonResult AddActive(Active model)
        {
            var service = new ActiveService();

            model.UserInfo_Id = int.Parse(Session ["user"].ToString());
            model.Steps       = new List <ActiveStep> ();
            service.Create(model);
            return(Json(true));
        }
Exemplo n.º 4
0
        public Active topic(int id)
        {
            IRedisClient  redisClient = RedisManager.GetClient();
            List <Active> activelist  = redisClient.Get <List <Active> >("active");
            Active        active      = activelist.Find(m => m.id == id);

            ActiveService.UpdateVisit_count(id);
            return(active);
        }
Exemplo n.º 5
0
        public List <Active> topics(string tab, int id)
        {
            List <Active> activelist = ActiveService.GetActiveList(tab, id);

            IRedisClient redisClient = RedisManager.GetClient();

            redisClient.Set <List <Active> >("active", activelist);
            redisClient.Save();
            redisClient.Dispose();

            return(activelist);
        }
Exemplo n.º 6
0
        /**
         * public PartialViewResult SearchActives()
         * {
         *      return SearchActives ((int)Session ["user"], 0, 0, 0, 0);
         * }
         **/
        public PartialViewResult SearchActivesBy(int userId, int formId, int subjectId, int phaseId, int contentId)
        {
            var service = new ActiveService();
            var enumer  = service.GetByUserId(userId, formId, subjectId, phaseId, contentId);
            var list    = new List <TPlan.ActiveDetailModel> ();
            var e       = enumer.GetEnumerator();

            while (e.MoveNext())
            {
                list.Add(new TPlan.ActiveDetailModel(e.Current));
            }
            return(PartialView("_Actives", list));
        }
Exemplo n.º 7
0
        private void UpdateSettings()
        {
            ConfigurationLoggingSession.ServerDirectory = ServiceDirectory;

            try
            {
                ConfigurationLoggingSession.WriteSettings(checkBoxEnableLogging.Checked, checkBoxLogDatasets.Checked);
                if (ActiveService != null && ActiveService.Status == System.ServiceProcess.ServiceControllerStatus.Running)
                {
                    ActiveService.SendMessage(MyDicomLoggingChannel.SettingsChanged);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 8
0
        public PartialViewResult AddPreSetStepToActive(int activeId)
        {
            var ids = new List <int> ();

            foreach (var key in Request.Form.AllKeys)
            {
                if (key.IndexOf("pss") != 0)
                {
                    continue;
                }
                var selected = (Request.Form [key] == "true,false");
                if (selected)
                {
                    ids.Add(int.Parse(key.Replace("pss", "")));
                }
            }
            var psss    = new PreSetStepService();
            var pss     = psss.GetByIds(ids);
            var service = new ActiveService();
            var active  = service.GetById(activeId);

            foreach (var s in pss)
            {
                var nas = new ActiveStep()
                {
                    OrderId         = (active.Steps.Count + 1),
                    Content         = s.Content,
                    Description     = s.Description,
                    UserDescription = s.Description
                };
                active.Steps.Add(nas);
            }

            service.UpdateSteps(activeId, active.Steps);
            return(PartialView("_ActiveSteps", active));
        }
Exemplo n.º 9
0
        public bool topic_collect(int author_id, int active_id)
        {
            bool result = ActiveService.Collect(author_id, active_id);

            return(result);
        }
Exemplo n.º 10
0
        public bool PostActive(string title, string content, int type, int PublisheriD)
        {
            bool result = ActiveService.PostActive(title, content, type, PublisheriD);

            return(result);
        }