//
        // GET: /ServicesTPAWise/

        //DataSet ds = new DataSet();
        public ActionResult ServicesTPAWise()
        {
            Buisness_Logic.Master.BL_ServiceTPAWise objServiceTPAWise = new Buisness_Logic.Master.BL_ServiceTPAWise();

            dsSer.ds = objServiceTPAWise.GetWardDetailsPivot();

            return(View(dsSer));
        }
        public JsonResult GetWardDetailsPivot()
        {
            Buisness_Logic.Master.BL_ServiceTPAWise objServiceTPAWise = new Buisness_Logic.Master.BL_ServiceTPAWise();
            dsSer.ds = objServiceTPAWise.GetWardDetailsPivot();
            var modeladd = new List <dynamic>(dsSer.ds.Tables[0].Rows.Count);
            int a        = 0;

            foreach (DataRow row in dsSer.ds.Tables[0].Rows)
            {
                var obj = (IDictionary <string, object>) new System.Dynamic.ExpandoObject();

                a = 0;

                foreach (DataColumn col in dsSer.ds.Tables[0].Columns)
                {
                    string Rowname = row[col].ToString();
                    //if (a > 3)
                    //{
                    //    if (row[col].ToString() == "")
                    //    {
                    //        row[col] = 0;
                    //    }

                    //    //string aa = Convert.ToDecimal(row["TotalAmount"]).ToString();
                    //    //string aa1 = Convert.ToDecimal(row[col]).ToString();
                    //    //decimal TotalPer = Convert.ToDecimal(row["TotalAmount"]) / 100 * Convert.ToDecimal(row[col]);

                    //    Rowname = "(" + row[col].ToString() + "%)" + " " + "(Rs " + Math.Round(TotalPer, 2).ToString() + ")";
                    //}

                    obj.Add(col.ColumnName, Rowname.ToString());
                    a++;
                }

                modeladd.Add(obj);
            }
            return(new JsonResult {
                Data = modeladd, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }