public JsonResult FillDepartment(Int64 ID_Department)
 {
     try
     {
         DataTable    dtbl         = new DataTable();
         BlDepartment bldepartment = new BlDepartment();
         bldepartment.MasterID   = ID_Department;
         bldepartment.UserCode   = Convert.ToInt64(Session["ID_Agent"]);
         bldepartment.FK_Company = Convert.ToInt64(Session["ID_Company"]);
         dtbl = bldepartment.SelectAllData();
         return(Json(Converttojson(dtbl), JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(ex));
     }
 }
 public JsonResult SelectDepartmentAll(string PageIndex = "1", string SearchItem = "")
 {
     try
     {
         int          statusCode   = 1;
         DataTable    dtbl         = new DataTable();
         BlDepartment bldepartment = new BlDepartment();
         bldepartment.PageIndex  = Convert.ToInt32(PageIndex);
         bldepartment.DepCode    = SearchItem;
         bldepartment.DepName    = SearchItem;
         bldepartment.FK_Company = Convert.ToInt64(Session["ID_Company"]);
         dtbl = bldepartment.SelectAllData();
         return(Json(Converttojson(dtbl), JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         ///
         return(Json(ex));
     }
 }