コード例 #1
0
ファイル: Lau_TamScanLogController.cs プロジェクト: dtafe/vnr
 /// <summary>
 /// [Tin.Nguyen] - Lấy dữ liệu Tủ Đồ(Lau_Locker) theo Id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Lau_TamScanLogModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Lau_TamScanLogModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetById<LMS_TamScanLogLMSEntity>(id, ref status);
     if (entity != null)
     {
         model = entity.CopyData<Lau_TamScanLogModel>();
     }
     model.ActionStatus = status;
     return model;
 }
コード例 #2
0
ファイル: Lau_GetDataController.cs プロジェクト: dtafe/vnr
 public ActionResult ExportLau_TamScanLogList([DataSourceRequest] DataSourceRequest request, Lau_TamScanLogModel model)
 {
     string statusExport = string.Empty;
     return Json(statusExport);
 }
コード例 #3
0
ファイル: Lau_GetDataController.cs プロジェクト: dtafe/vnr
        public ActionResult GetTAMData([DataSourceRequest] DataSourceRequest request, Lau_TamScanLogModel model)
        {
            var service = new Lau_TamServices();
            List<Guid> listOrgStructureID = new List<Guid>();

            DateTime dateFrom = DateTime.Now.Date;
            DateTime dateTo = DateTime.Now.Date;

            if (model.DateFrom.HasValue)
            {
                dateFrom = model.DateFrom.Value;
            }

            if (model.DateTo.HasValue)
            {
                dateTo = model.DateTo.Value;
            }

            model.AsynTaskID = service.CreateComputingTask(model.UserID,
                dateFrom, dateTo);

            if (model.ProfileID != null && model.ProfileID.Count > 0)
            {
                Task task = Task.Run(() => service.SyncTAMLog(model.UserID,
                    model.AsynTaskID, false, dateFrom, dateTo, model.ProfileID));
            }
            else
            {
                if (model.OrgStructureID != null)
                {
                    listOrgStructureID = model.OrgStructureID.Where(d => d.HasValue).Select(d => d.Value).ToList();
                }

                Task task = Task.Run(() => service.SyncTAMLog(model.UserID, model.AsynTaskID,
                    false, dateFrom, dateTo, listOrgStructureID, null, null));
            }

            return Json(model, JsonRequestBehavior.AllowGet);
        }