示例#1
0
        public static string getDefPage(string user)
        {
            string page = "";

            string param = "type@string@Page" +
                           "#filter@string@home" +
                           "#User@string@" + user;
            DataTable dt = Configs._query.executeProc("_getControlByType", param);

            if (MTools.verifyDataTable(dt))
            {
                page = dt.Rows[0]["Link"].ToString();
            }


            return(page);
        }
示例#2
0
        public static string GetJson(DataTable datatable)
        {
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new

                                                                              System.Web.Script.Serialization.JavaScriptSerializer();
            List <Dictionary <string, object> > rows =
                new List <Dictionary <string, object> >();
            Dictionary <string, object> row = null;

            if (MTools.verifyDataTable(datatable))
            {
                foreach (DataRow dr in datatable.Rows)
                {
                    row = new Dictionary <string, object>();
                    foreach (DataColumn col in datatable.Columns)
                    {
                        row.Add(col.ColumnName.Trim(), dr[col]);
                    }
                    rows.Add(row);
                }
            }
            return(serializer.Serialize(rows));
        }