コード例 #1
0
ファイル: dsnguoidung.asmx.cs プロジェクト: kyhuuchi/qlpr
        public void BaoCaoDoanhSoNhapKhoTheoThangTheoDonVi(int id_phongban, string tungay, string denngay)
        {
            Kho       kho = new Kho();
            DataTable tb  = kho.BaoCaoDoanhSoNhapKhoTheoThangTheoDonVi(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));
        }