public DataTable QueryTableByObjid(string tableName, int objid)
        {
            ClarifyDataAccessWS clarifyDA = new ClarifyDataAccessWS(session);

            DataQuery gen = clarifyDA.CreateDataQuery(tableName);

            gen.AppendFilter("objid", "Equals", objid.ToString());

            DataSet ds = GetDataSetFromXml(gen.Query(true));

            return(ds.Tables[tableName] != null && ds.Tables[tableName].Rows.Count > 0 ? ds.Tables[tableName] : null);
        }
        public override void DataBind()
        {
            base.DataBind();

            string username = ConfigurationManager.AppSettings["fcsdk.clarifysession.username"];

            // Show username to currect user
            currentUserLabel.Text = String.Format(" <i>({0})</i>", username);

            // Get session from Global.asax.cs
            ClarifySessionWS session = Global.ClarifySessWS;

            // Create ClarifyDataAccessWS
            ClarifyDataAccessWS dataAccess = new ClarifyDataAccessWS(session);

            // Create new DataQuery to query view "qry_case_view"
            DataQuery caseQuery = dataAccess.CreateDataQuery("qry_case_view");

            // Set fields to select
            caseQuery.DataFields.AddRange(
                new string[] { "id_number", "site_name", "title", "condition", "status", "creation_time", "owner" });

            // Append filters for query
            caseQuery.AppendFilter("owner", "Equals", username);
            caseQuery.AppendFilter("condition", "Like", "Open%");

            // Append sorting for query
            caseQuery.AppendSort("creation_time", false);

            // Get Xml result
            string result = caseQuery.Query(true);

            // Create a string reader to read the result
            System.IO.StringReader reader = new System.IO.StringReader(result);

            // Create and load the DataSet with the result
            DataSet ds = new DataSet();

            ds.ReadXml(reader);

            // Data bind DataGrid to result table in DataSet
            this.openCasesGrid.DataSource = ds.Tables["qry_case_view"];
            this.openCasesGrid.DataBind();
        }
예제 #3
0
		public override void DataBind()
		{
			base.DataBind ();

			// Get session from Global.asax.cs
			ClarifySessionWS session = Global.ClarifySessWS;

			// Create ClarifyDataAccessWS
			ClarifyDataAccessWS dataAccess = new ClarifyDataAccessWS( session );

			// Create new DataQuery to query view "qry_case_view"
			DataQuery caseQuery = dataAccess.CreateDataQuery("qry_case_view");

			// Set fields to select
			caseQuery.DataFields.AddRange( 
				new string[]{"id_number", "site_name", "title", "condition", "status", "creation_time", "owner"} );

			// Append filters for query
			caseQuery.AppendFilter( "creation_time", "MoreThanOrEqual", DateTime.Now.AddDays(DaysBack * -1).ToShortDateString() );

			// Append sorting for query
			caseQuery.AppendSort( "creation_time", false );

			// Get Xml result
			string result = caseQuery.Query(true);

			// Create a string reader to read the result
			System.IO.StringReader reader = new System.IO.StringReader(result);

			// Create and load the DataSet with the result
			DataSet ds = new DataSet();
			ds.ReadXml( reader );

			// Data bind DataGrid to result table in DataSet
			this.casesCreatedGrid.DataSource = ds.Tables["qry_case_view"];
			this.casesCreatedGrid.DataBind();
		}
        public DataTable QueryTableByObjid(string tableName, int objid)
        {
            ClarifyDataAccessWS clarifyDA = new ClarifyDataAccessWS(session);

            DataQuery gen = clarifyDA.CreateDataQuery(tableName);
            gen.AppendFilter("objid", "Equals", objid.ToString());

            DataSet ds = GetDataSetFromXml(gen.Query(true));

            return ds.Tables[tableName] != null && ds.Tables[tableName].Rows.Count > 0 ? ds.Tables[tableName] : null;
        }