예제 #1
0
        public void BaoCaoSoLuongPOTheoThangTheoDonVi(int id_phongban, string tungay, string denngay)
        {
            PO        pr = new PO();
            DataTable tb = pr.BaoCaoSoLuongPOTheoThangTheoDonVi(id_phongban, tungay, denngay);
            var       js = new JavaScriptSerializer();

            List <Dictionary <string, object> > parentRow = new List <Dictionary <string, object> >();
            Dictionary <string, object>         childRow;

            foreach (DataRow row in tb.Rows)
            {
                childRow = new Dictionary <string, object>();
                foreach (DataColumn col in tb.Columns)
                {
                    childRow.Add(col.ColumnName, row[col]);
                }
                parentRow.Add(childRow);
            }

            Context.Response.Write(JsonConvert.SerializeObject(parentRow));
        }