Example #1
0
        public JsonResult GetSearchClientData(string xmlData)
        {
            DataTable             dt             = new DataTable();
            List <List <string> > listarray      = new List <List <string> >();
            eTrackingAccessLayer  objprovinvoice = new eTrackingAccessLayer();

            try
            {
                DataSet ds = objprovinvoice.DisplayEtrackingData(xmlData);

                if (ds.Tables.Count > 0)
                {
                    dt = ds.Tables[0];
                }

                List <String> columnlist = (from dc in dt.Columns.Cast <DataColumn>()
                                            select dc.ColumnName).ToList();
                listarray.Add(columnlist);
                foreach (DataRow dr in dt.Rows)
                {
                    List <String> jst = dr.ItemArray.Select(o => o.ToString()).ToList();
                    listarray.Add(jst);
                }
            }
            catch (Exception ex)
            {
            }
            var jsonResult = Json(listarray);

            jsonResult.MaxJsonLength = int.MaxValue;
            return(jsonResult);
        }
Example #2
0
        public JsonResult ShowEtrackingData(string xmlData)
        {
            DataTable             dt             = new DataTable();
            List <List <string> > listarray      = new List <List <string> >();
            eTrackingAccessLayer  objprovinvoice = new eTrackingAccessLayer();

            try
            {
                DataSet ds = objprovinvoice.DisplayEtrackingData(xmlData);

                if (ds.Tables.Count > 0)
                {
                    dt = ds.Tables[0];
                }

                if (dt.Columns.Count > 2)
                {
                    DataRow dtDr = dt.NewRow();
                    dtDr[20] = dt.Compute("Sum(PreVatAmount)", "").ToString();
                    dtDr[21] = dt.Compute("Sum(VatAmount)", "").ToString();
                    dtDr[22] = dt.Compute("Sum(NetAmount)", "").ToString();
                    dt.Rows.Add(dtDr);
                }

                List <String> columnlist = (from dc in dt.Columns.Cast <DataColumn>()
                                            select dc.ColumnName).ToList();
                listarray.Add(columnlist);
                foreach (DataRow dr in dt.Rows)
                {
                    List <String> jst = dr.ItemArray.Select(o => o.ToString()).ToList();
                    listarray.Add(jst);
                }
            }
            catch (Exception ex)
            {
            }
            var jsonResult = Json(listarray);

            jsonResult.MaxJsonLength = int.MaxValue;
            return(jsonResult);
        }