public static string GetAllSpDetails(string pregistration_no)
        {
            SpManager spManager = new SpManager();

            DataTable dt = new DataTable();

            if (HttpContext.Current.Session["BranchId"] != null)
            {
                if (!HttpContext.Current.Session["BranchId"].ToString().Equals("0001"))
                {
                    dt = spManager.GetSpDetailsByReg(pregistration_no);
                    DataColumn[] columns  = dt.Columns.Cast <DataColumn>().ToArray();
                    bool         contains = dt.AsEnumerable()
                                            .Any(row => columns.Any(col => row[col].ToString() == HttpContext.Current.Session["BranchId"].ToString()));
                    if (contains)
                    {
                        dt = dt.AsEnumerable().Where(r => r.Field <string>("BRANCH_NAME") == HttpContext.Current.Session["BranchId"].ToString()).CopyToDataTable();
                    }
                    else
                    {
                        dt = new DataTable();
                    }
                }
            }
            return(DatatableToJson(dt));
        }