public JsonResult SelectClientAll(string PageIndex = "1", string SearchItem = "")
        {
            try
            {
                int     statusCode = 1;
                DataSet ds         = new DataSet();

                BlClient blclient = new BlClient();
                blclient.PageIndex  = Convert.ToInt32(PageIndex);
                blclient.FK_Company = Convert.ToInt64(Session["ID_Company"]);

                blclient.CliCode = SearchItem;
                blclient.CliName = SearchItem;
                blclient.ResName = SearchItem;
                ds = blclient.SelectAllData();
                DataTable dtblClient       = ds.Tables[0];
                DataTable dtblClientDetail = ds.Tables[1];
                return(Json(Converttojson(dtblClient), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ///
                return(Json(ex));
            }
        }
 public JsonResult FillClient(Int64 ID_Client)
 {
     try
     {
         DataSet   ds       = new DataSet();
         DataTable dtbl     = new DataTable();
         BlClient  blclient = new BlClient();
         blclient.MasterID   = ID_Client;
         blclient.UserCode   = Convert.ToInt64(Session["ID_Agent"]);
         blclient.FK_Company = Convert.ToInt64(Session["ID_Company"]);
         ds = blclient.SelectAllData();
         DataTable Dt  = ds.Tables[0];
         DataTable Dt1 = ds.Tables[1];
         return(Json(new { table = "" + Converttojson(Dt) + "", table1 = "" + Converttojson(Dt1) + "" }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(ex));
     }
 }