예제 #1
0
        public ActionResult AddValue(testData vData, int id, int docId, FormCollection collection)
        {
            vData.PolicyDocument = new PolicyDocumentEntity(docId);

            vData.Query = new QueryEntity(id);
            if (vData.Query.IsNew)
                vData.Query.LibraryId = vData.Library.Id;

            vData.Query.Description = collection["description"];

            QueryValueEntity cive = new QueryValueEntity();
            int parse;
            if (collection["attributeId"] != null && int.TryParse(collection["attributeId"], out parse))
            {
                cive.AttributeId = parse;
                cive.Value = collection["attributeValue"];
                cive.Extra = collection["extra"];
                cive.Query = vData.Query;
            }

            vData.Query.Save(true);

            return RedirectToAction("EditQuery", new { docId = vData.PolicyDocument.Id, id = vData.Query.Id });
        }
예제 #2
0
        public ActionResult DeleteValue(testData vData, int id, int docId)
        {
            vData.PolicyDocument = new PolicyDocumentEntity(docId);

            QueryValueEntity cive = new QueryValueEntity(id);
            vData.Query = new QueryEntity(cive.QueryId);
            cive.Delete();

            return RedirectToAction("EditQuery", new { docId = vData.PolicyDocument.Id, id = vData.Query.Id });
        }
예제 #3
0
        public ActionResult DuplicateQuery(testData vData, int docId, int id)
        {
            vData.PolicyDocument = new PolicyDocumentEntity(docId);
            vData.Query = new QueryEntity(id);

            QueryEntity newQuery = new QueryEntity(id);
            duplicator.MarkEntityDirty(newQuery);
            newQuery.IsNew = true;
            newQuery.Description += " copy";
            newQuery.Save();

            foreach (QueryValueEntity qve in vData.Query.QueryValue)
            {
                QueryValueEntity qveNew = new QueryValueEntity(qve.Id);
                duplicator.MarkEntityDirty(qveNew);
                qveNew.IsNew = true;
                qveNew.Query = newQuery;
                qveNew.Save();
            }

            return RedirectToAction("EditQuery", "test", new { docId = docId, id = newQuery.Id });
        }
        /// <summary>Creates a new, empty QueryValueEntity object.</summary>
        /// <returns>A new, empty QueryValueEntity object.</returns>
        public override IEntity Create()
        {
            IEntity toReturn = new QueryValueEntity();

            // __LLBLGENPRO_USER_CODE_REGION_START CreateNewQueryValue
            // __LLBLGENPRO_USER_CODE_REGION_END
            return toReturn;
        }