/// <summary> /// ExportExcel File /// </summary> /// <returns></returns> public string ExportExcel(string searchprm = "") { RBVHSearchFilter SearchKey = BindSearchHRDB(searchprm); RBVHEmployeeCollection collection = RBVHEmployeeManager.Search(SearchKey); DataTable dt = collection.ToDataTable <RBVHEmployee>(); string fileName = "RBVHEmployee_" + SystemConfig.CurrentDate.ToString("MM-dd-yyyy"); //string[] RemoveColumn = { "CompanyID" , "TargetDisplayID", "ReturnDisplay","TotalRecord", "CreatedUser","CreatedDate"}; //for (int i = 0; i < RemoveColumn.Length; i++) //{ // if (dt.Columns.Contains(RemoveColumn[i])) // { // dt.Columns.Remove(RemoveColumn[i]); // } //} HeaderItemCollection RemoveColumn = CommonHelper.HideColumn <RBVHEmployee>(CurrentUser, "RBVHEmployee"); for (int i = 0; i < RemoveColumn.Count; i++) { if (dt.Columns.Contains(RemoveColumn[i].name)) { dt.Columns.Remove(RemoveColumn[i].name); } } FileInputHelper.ExportExcel(dt, fileName, "RBVHEmployee List", false); return(fileName); }
public ContentResult Search(RBVHSearchFilter SearchKey) { SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "EmployeeCode" : SearchKey.OrderBy; RBVHEmployeeCollection collection = RBVHEmployeeManager.Search(SearchKey); return(Content(JsonConvert.SerializeObject(collection), "application/json")); }
/// <summary> /// use for scrolling page /// </summary> /// <returns></returns> public ContentResult GetPg(int page, int pagesize) { string condition = ""; RBVHSearchFilter SearchKey = RBVHSearchFilter.SearchPG(1, page, pagesize, "EmployeeCode,FirstName_EN,MiddleName_EN,LastName_EN,DomainId", "EmployeeCode", "Desc", condition); RBVHEmployeeCollection objItem = RBVHEmployeeManager.Search(SearchKey); return(Content(JsonConvert.SerializeObject(objItem), "application/json")); }
public JsonResult GetActiveData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel) { RBVHSearchFilter SearchKey = RBVHSearchFilter.SearchData(1, requestModel, "EmployeeCode,FirstName_EN,MiddleName_EN,LastName_EN,DomainId", "EmployeeCode"); SearchKey.Condition = " IsActive=0 "; RBVHEmployeeCollection collection = RBVHEmployeeManager.Search(SearchKey); int TotalRecord = 0; if (collection.Count > 0) { TotalRecord = collection[0].TotalRecord; } return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet)); }
public JsonResult GetHRBPSearchData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel, string searchprm) { RBVHSearchFilter SearchKey = BindSearchHRDB(searchprm); SearchKey = RBVHSearchFilter.SearchData(SearchKey, requestModel); RBVHEmployeeCollection collection = RBVHEmployeeManager.Search(SearchKey); int TotalRecord = 0; if (collection.Count > 0) { TotalRecord = collection[0].TotalRecord; } return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet)); }