Exemplo n.º 1
0
 public Can_TamScanLogModel Delete(Guid id)
 {
     var service = new Can_TamScanLogServices();
     service.Delete<Can_TamScanLogEntity>(id);
     var result = new Can_TamScanLogModel();
     return result;
 }
Exemplo n.º 2
0
 public Can_TamScanLogModel Get(Guid id)
 {
     string status = string.Empty;
     var model = new Can_TamScanLogModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetData<Can_TamScanLogEntity>(id, ConstantSql.hrm_can_sp_get_tamscanlogbyid, ref status).FirstOrDefault();
     if (entity != null)
     {
         model = entity.CopyData<Can_TamScanLogModel>();
     }
     model.ActionStatus = status;
     return model;
 }
Exemplo n.º 3
0
        public ActionResult GetTAMData([DataSourceRequest] DataSourceRequest request, Can_TamScanLogModel model)
        {
            var service = new Can_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);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Xử lí eidt và add new truyền theo script
        /// </summary>
        /// <param name="contract"></param>
        /// <returns></returns>     
        public Can_TamScanLogModel Post(Can_TamScanLogModel model)
        {

            ActionService service = new ActionService(UserLogin);
            return service.UpdateOrCreate<Can_TamScanLogEntity, Can_TamScanLogModel>(model);
        }