Ejemplo n.º 1
0
        public void TestEq()
        {
            //Text Field
            string caml = CamlBuilder.BuildCaml(TestList, new Eq("textcol", "text1"));

            Assert.IsNotNull(caml);
            this.spQuery.Query = caml;
            var items = this.TestList.GetItems(this.spQuery);

            Assert.IsTrue(items.Count == 1);

            //Number Field
            caml = CamlBuilder.BuildCaml(TestList, new Eq("numbercol", "100"));
            Assert.IsNotNull(caml);
            this.spQuery.Query = caml;
            items = this.TestList.GetItems(this.spQuery);
            Assert.IsTrue(items.Count == 1);

            //DateTime Field
            DateTime dt  = new DateTime(2000, 1, 1, 5, 10, 59);
            string   dts = Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(dt);

            caml = CamlBuilder.BuildCaml(TestList, new Eq("datetimecol", dts));
            Assert.IsNotNull(caml);
            this.spQuery.Query = caml;
            items = this.TestList.GetItems(this.spQuery);
            Assert.IsTrue(items.Count == 1);

            //Bool Field
            caml = CamlBuilder.BuildCaml(TestList, new Eq("BoolCol", "1"));
            Assert.IsNotNull(caml);
            this.spQuery.Query = caml;
            items = this.TestList.GetItems(this.spQuery);
            Assert.IsTrue(items.Count == 1);
        }
Ejemplo n.º 2
0
        public static bool grantPermission(String cuurentUserId, String listName, String fileID)
        {
            var spClient = GetInstance(listName);
            List <CamlQuery_oneField> dataToUpdate = new List <CamlQuery_oneField>();

            dataToUpdate.Add(new CamlQuery_oneField("ID", "Text", fileID, CamlQuery_oneField.EQ_COMP));
            dataToUpdate.Add(new CamlQuery_oneField("permissions", "Text", ";#-1;#i:0#.w|" + cuurentUserId, CamlQuery_oneField.EQ_COMP));
            spClient.updateRecored(CamlBuilder.buildCamlUpdateQuery(dataToUpdate));
            return(true);
        }
Ejemplo n.º 3
0
        public void TestAnd()
        {
            string caml = CamlBuilder.BuildCaml(TestList, new And(new Eq("textCol", "text1"), new Eq("ID", "1")));

            Assert.IsNotNull(caml);
            this.spQuery.Query = caml;
            var items = this.TestList.GetItems(this.spQuery);

            Assert.IsTrue(items.Count == 1);
        }
Ejemplo n.º 4
0
        public static List <EservicesDomain.ExternalDomain.SP.Attachment> getAttachments(String listName, String jobID)
        {
            SharePointHandler spClient         = GetInstance(listName);
            string            viewFieldsCluase = CamlBuilder.buildCamlViewFields(new string[] { "ID", "Name", "upLoaderName", "activityName", "Created" });
            string            queryOptions     = CamlBuilder.buildCamlQueryOptions(folder: listName + "/" + jobID, recursive: true);

            List <Dictionary <String, Object> > data = spClient.viewRecord(viewFieldsCluase, null, queryOptions);
            List <EservicesDomain.ExternalDomain.SP.Attachment> returnedData = SPFacade.getAttachmentsList(data, listName);

            return(returnedData);
        }