Пример #1
0
        public ActionResult Index(Guid qid)
        {
            LongRunningOperation.RemoveExisting(CurrentDatabase, qid);
            var model = new AddToOrgFromTag(qid);

            return(View(model));
        }
Пример #2
0
        public ActionResult Index(int id, string group)
        {
            var model = new AddToOrgFromTag(id, group);

            model.RemoveExistingLop(DbUtil.Db, id, AddToOrgFromTag.Op);
            return(View(model));
        }
Пример #3
0
        public ActionResult Process(AddToOrgFromTag model)
        {
            var op = new AddToOrgFromTag(model.QueryId, CurrentDatabase);

            op.Tag       = model.Tag;
            op.Count     = model.Count;
            op.Started   = model.Started;
            op.Completed = model.Completed;

            op.Validate(ModelState);

            if (!ModelState.IsValid) // show validation errors
            {
                return(View("Index", op));
            }

            op.UpdateLongRunningOp(CurrentDatabase, AddToOrgFromTag.Op);
            if (op.ShowCount(CurrentDatabase))
            {
                return(View("Index", op)); // let them confirm by seeing the count and the tagname
            }

            if (!op.Started.HasValue)
            {
                DbUtil.LogActivity($"Add to org from tag for {Session["ActiveOrganization"]}");
                op.Process(CurrentDatabase);
            }

            return(View(op));
        }
Пример #4
0
        public ActionResult Process(AddToOrgFromTag model)
        {
            model.Validate(ModelState);

            if (!ModelState.IsValid) // show validation errors
            {
                return(View("Index", model));
            }

            model.UpdateLongRunningOp(DbUtil.Db, AddToOrgFromTag.Op);
            if (model.ShowCount(DbUtil.Db))
            {
                return(View("Index", model)); // let them confirm by seeing the count and the tagname
            }
            if (!model.Started.HasValue)
            {
                DbUtil.LogActivity($"Add to org from tag for {Session["ActiveOrganization"]}");
                model.Process(DbUtil.Db);
            }

            return(View(model));
        }