Exemple #1
0
        public void parseJSON(string dt)
        {
            jDataModel rdt = Newtonsoft.Json.JsonConvert.DeserializeObject <jDataModel>(dt);

            this.TableName = rdt.TableName;
            this.Columns   = new jDataColumn(rdt.Columns);
            this.Rows      = new jDataRowCollection(rdt.Rows);

            DataSource = new DataTable(this.TableName);
            this.Columns.UpdateDataTable(DataSource);
            this.Rows.UpdateDataTable(DataSource);
        }
Exemple #2
0
        /// <summary>
        /// Must Call if need to use as JSON Object
        /// </summary>
        /// <returns></returns>
        public jDataModel JsonModel()
        {
            var m = new jDataModel();

            m.TableName = this.TableName;
            m.Columns   = this.Columns;
            m.Rows      = new List <Dictionary <string, object> >();
            foreach (jDataRow dr in this.Rows)
            {
                m.Rows.Add(dr);
            }
            return(m);
        }
Exemple #3
0
 public jDataTable(jDataModel model)
 {
     try
     {
         this.TableName = model.TableName;
         this.Columns   = new jDataColumn(model.Columns);
         this.Rows      = new jDataRowCollection(model.Rows);
         this.SetDataSource();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }