Beispiel #1
0
        public QueryObject GetSigleQuery(int queryId, string userCode)
        {
            try
            {
                GetQueryObject PostDataArrived = new GetQueryObject()
                {
                    QueryId  = queryId.ToString(),
                    UserCode = userCode
                };
                ConnectionStringSettings connectionStringSetting = ConfigurationManager.ConnectionStrings["ISTATWebClientConnection"];
                if (connectionStringSetting == null || string.IsNullOrEmpty(connectionStringSetting.ConnectionString))
                {
                    throw new Exception("ConnectionString not set");
                }

                QueryWidget        qw  = new QueryWidget(connectionStringSetting.ConnectionString);
                List <QueryObject> res = qw.Get(PostDataArrived);
                if (res != null && res.Count == 1)
                {
                    return(res[0]);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                return(null);
            }
        }
        public ActionResult Get()
        {
            try
            {
                GetQueryObject PostDataArrived = CS.GetPostData<GetQueryObject>(this.Request);
                ConnectionStringSettings connectionStringSetting = ConfigurationManager.ConnectionStrings["ISTATWebClientConnection"];
                if (connectionStringSetting == null || string.IsNullOrEmpty(connectionStringSetting.ConnectionString))
                    throw new Exception("ConnectionString not set");

                QueryWidget qw = new QueryWidget(connectionStringSetting.ConnectionString);
                return CS.ReturnForJQuery(qw.Get(PostDataArrived));
            }
            catch (Exception ex)
            {
                return CS.ReturnForJQuery(ex.Message);
            }
        }
Beispiel #3
0
        public ActionResult Get()
        {
            try
            {
                GetQueryObject           PostDataArrived         = CS.GetPostData <GetQueryObject>(this.Request);
                ConnectionStringSettings connectionStringSetting = ConfigurationManager.ConnectionStrings["ISTATWebClientConnection"];
                if (connectionStringSetting == null || string.IsNullOrEmpty(connectionStringSetting.ConnectionString))
                {
                    throw new Exception("ConnectionString not set");
                }

                QueryWidget qw = new QueryWidget(connectionStringSetting.ConnectionString);
                return(CS.ReturnForJQuery(qw.Get(PostDataArrived)));
            }
            catch (Exception ex)
            {
                return(CS.ReturnForJQuery(ex.Message));
            }
        }
        public QueryObject GetSigleQuery(int queryId, string userCode)
        {
            try
            {
                GetQueryObject PostDataArrived = new GetQueryObject()
                {
                    QueryId = queryId.ToString(),
                    UserCode = userCode
                };
                ConnectionStringSettings connectionStringSetting = ConfigurationManager.ConnectionStrings["ISTATWebClientConnection"];
                if (connectionStringSetting == null || string.IsNullOrEmpty(connectionStringSetting.ConnectionString))
                    throw new Exception("ConnectionString not set");

                QueryWidget qw = new QueryWidget(connectionStringSetting.ConnectionString);
                List<QueryObject> res = qw.Get(PostDataArrived);
                if (res != null && res.Count == 1)
                    return res[0];
                else
                    return null;
            }
            catch (Exception)
            {
                return null;
            }
        }