public static MissingScanTimeCollection GetExMonthlyReport(MissCanTimePara WebPara) { MissingScanTimeCollection items = new MissingScanTimeCollection(); using (var client = WebApiHelper.myclient(HouseEndpoint, SystemConst.APIJosonReturnValue)) { HttpResponseMessage response = client.PostAsJsonAsync(string.Format("Report"), WebPara).GetAwaiter().GetResult(); if (response.IsSuccessStatusCode) { items = response.Content.ReadAsAsync <MissingScanTimeCollection>().GetAwaiter().GetResult(); } } return(items); }
//public ContentResult Get(string EmployeeNo, string WD) //{ // return Content(JsonConvert.SerializeObject(collection), "application/json"); // //return View(ViewFolder + "EmpTms.cshtml"); //} public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel) { MissCanTimePara b = new MissCanTimePara() { StartDate = DateTime.Now.AddDays(-31), EndDate = DateTime.Now, EmployeeCode = 0, EntityID = 10001 }; MissingScanTimeCollection collection = ReportManager.GetExMonthlyReport(b); // SearchFilter SearchKey = SearchFilter.SearchData(1, requestModel, "Id", "Id"); // T_LMS_Trans_LeaveStoryCollection collection = T_LMS_Trans_LeaveStoryManager.Search(SearchKey); // int TotalRecord = 0; // if (collection.Count > 0) // { // TotalRecord = collection[0].TotalRecord; // } return(Json(new DataTablesResponse(requestModel.Draw, collection, collection.Count, collection.Count), JsonRequestBehavior.AllowGet)); }
public string ExportExcel() { MissCanTimePara b = new MissCanTimePara() { StartDate = DateTime.Now.AddDays(-31), EndDate = DateTime.Now, EmployeeCode = 0 }; MissingScanTimeCollection collection = ReportManager.GetExMonthlyReport(b); DataTable dt = collection.ToDataTable <MissingScanTime>(); 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]); } } DataSet ds = new DataSet(); ds.Tables.Add(dt); //set Column Date Format int[] DateColumn = { 8, 9, 10, 11 }; string[] sheetName = { "Daily_TMS" }; ExcelPara mypara = new ExcelPara() { ds = ds, sheetName = sheetName, fileName = fileName, DateColumns = DateColumn, DateFormat = "h:mm:ss" }; FileInputHelper.ExportMultiSheetExcelExtend(mypara); FileInputHelper.ExportExcel(dt, fileName, "RBVHEmployee List", false); return(fileName); }
public static MissingScanTimeCollection GetMissingScanTime(MissCanTimePara objPara) { var pars = new SqlParameter[] { new SqlParameter("@EmployeeCode", objPara.EmployeeCode), new SqlParameter("@StartDate", objPara.StartDate), new SqlParameter("@EndDate", objPara.EndDate), new SqlParameter("@EntityID", objPara.EntityID), }; MissingScanTimeCollection collection = new MissingScanTimeCollection(); using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "USP_TMS_NotFillScanTime_Report", pars)) { MissingScanTime obj = new MissingScanTime(); while (reader.Read()) { obj = BindScanTimeData(reader); collection.Add(obj); } } return(collection); }