Esempio n. 1
0
        public string abc()
        {
            dt.Clear();
            ProductAdminBLL bll = new ProductAdminBLL();
            dt = bll.Categories();

            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;

            foreach (DataRow dr in dt.Rows)
            {

                row = new Dictionary<string, object>();

                foreach (DataColumn col in dt.Columns)
                {

                    row.Add(col.ColumnName, dr[col]);

                }

                rows.Add(row);

            }

            return serializer.Serialize(rows);
        }
Esempio n. 2
0
 //
 // GET: /ProdAdmin/
 public ActionResult Index()
 {
     ProductAdminBLL bll = new ProductAdminBLL();
     List<Category> cat = bll.Categories();
     return View(cat);
 }