Пример #1
0
        public DataSet ExecuteQuery(string Query)
        {
            Model.SQLContext db = new Model.SQLContext();
            db.Qry = Query;
            string data = this.PostData("SQL/ExecuteQuery", GetJSONBytes(db));

            return(this.GetDataSet <DataSet>(this.GetResult(data, "ExecuteQueryResult")));
        }
Пример #2
0
        public DataSet ExecuteQuery(string Query, string[] Parameter, object[] Value)
        {
            Model.SQLContext db = new Model.SQLContext();
            db.Qry        = Query;
            db.Parameters = Parameter;
            db.Values     = Value;

            string data = this.PostData("SQL/ExecuteQueryPrepared", GetJSONBytes(db));

            return(this.GetDataSet <DataSet>(this.GetResult(data, "ExecuteQueryPreparedResult")));
        }
Пример #3
0
 public object ExecuteScalar(string Query)
 {
     try
     {
         Model.SQLContext db = new Model.SQLContext();
         db.Qry = Query;
         string data = this.PostData("SQL/ExecuteScalar", GetJSONBytes(db));
         return(this.GetResult(data, "ExecuteScalarResult").ResultSet);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #4
0
 public void ExecuteNonQuery(string Query)
 {
     try
     {
         Model.SQLContext db = new Model.SQLContext();
         db.Qry = Query;
         string data = this.PostData("SQL/ExecuteNonQuery", GetJSONBytes(db));
         this.GetResult(data, "ExecuteNonQueryResult");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #5
0
 public void ExecuteNonQuery(string Query, string[] Parameter, object[] Value)
 {
     try
     {
         Model.SQLContext db = new Model.SQLContext();
         db.Qry        = Query;
         db.Parameters = Parameter;
         db.Values     = Value;
         string data = this.PostData("SQL/ExecuteNonQueryPrepared", GetJSONBytes(db));
         this.GetResult(data, "ExecuteNonQueryPreparedResult");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #6
0
        public byte[] GetJSONBytes(Model.SQLContext db)
        {
            string j = Newtonsoft.Json.JsonConvert.SerializeObject(db);

            return(System.Text.ASCIIEncoding.Default.GetBytes(j));
        }