Ejemplo n.º 1
0
        // GET api/<controller>/5
        public Can_MealRecordMissingModel Get(Guid id)
        {
            var service = new Can_MealRecordMissingServices();
            var result = service.GetData<Can_MealRecordMissingEntity>(id, ConstantSql.hrm_can_sp_get_MealRecordMissingId,UserLogin, ref status).FirstOrDefault();
            var model = new Can_MealRecordMissingModel
            {
                ID = result.ID,
                ProfileID = result.ProfileID,
                TamScanReasonMissID = result.TamScanReasonMissID,
                WorkDate = result.WorkDate,
                Amount = result.Amount,
                Status = result.Status,
                MealAllowanceTypeSettingID = result.MealAllowanceTypeSettingID,
                IsFullPay = result.IsFullPay,
                Type = result.Type,
                EmpCode = result.EmpCode,
                OrgStructureID = result.OrgStructureID,
                OrgStructureName = result.OrgStructureName,
                TamScanReasonMissName = result.TamScanReasonMissName,
                MealAllowanceTypeSettingName = result.MealAllowanceTypeSettingName
            };

            model.ActionStatus = status;
            return model;
        }
Ejemplo n.º 2
0
 //SonVo - 20140803 - chuyển trạng thái submit màn hình Dữ liệu quên quẹt thẻ
 public ActionResult SubmitMealRecordMissing(string selectedIds, string status)
 {
     List<Guid> ids = new List<Guid>();
     if (selectedIds != null)
     {
         ids = selectedIds
            .Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
            .Select(x => Guid.Parse(x))
            .ToList();
     }
     var lstMealRecordMissing = new List<Can_MealRecordMissingEntity>();
     var services = new Can_MealRecordMissingServices();
     services.SubmitStatus(ids, status);
     return Json("");
 }
Ejemplo n.º 3
0
        public ActionResult GetMealRecordMissingList([DataSourceRequest] DataSourceRequest request, Can_MealRecordMissingSearchModel model)
        {
            var service = new Can_MealRecordMissingServices();
            var hrService = new Hre_ProfileServices();
            DateTime DateFrom = SqlDateTime.MinValue.Value;
            DateTime DateTo = SqlDateTime.MaxValue.Value;
            if (model.DateFrom != null)
            {
                DateFrom = model.DateFrom.Value;
            }
            if (model.DateTo != null)
            {
                DateTo = model.DateTo.Value;
            }
            //string strOrgIDs = Common.ListToString(model.OrgStructureID);
            #region xử lý lấy lstProfileIds theo OrgStructureID
            List<Guid> lstProfileIDs = new List<Guid>();
            string status = string.Empty;
            List<object> lstObj = new List<object>();

            //lstObj.Add(strOrgIDs); 
            lstObj.Add(model.OrgStructureID);
            lstObj.Add(null);
            lstObj.Add(null);
            List<Guid> _temp = new List<Guid>();
            List<Guid> _profileIDs = new List<Guid>();
            var baseService = new ActionService(UserLogin);
            if (model.ProfileIDSearch != null)
            {
                var lst = model.ProfileIDSearch.Split(',');
                _temp = lst.Select(Guid.Parse).ToList();

                if (model.OrgStructureID != null)
                {
                    lstProfileIDs = baseService.GetData<Hre_ProfileIdEntity>(lstObj, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrg, ref status).Select(m => m.ID).ToList();
                    _profileIDs = lstProfileIDs.Where(m => !_temp.Contains(m)).ToList();
                    lstProfileIDs.AddRange(_profileIDs);
                }
                else
                {
                    lstProfileIDs = _temp;
                }
            }
            else
            {
                lstProfileIDs = baseService.GetData<Hre_ProfileIdEntity>(lstObj, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrg, ref status).Select(m => m.ID).ToList();
            }
            #endregion
            // var result = service.GetAllUseEntity<Can_MealRecordMissingEntity>(ref status);

            service.ComputeMealRecordMissing(lstProfileIDs,
                DateFrom,
                DateTo,
                model.TamScanReasonMissID,
                model.Status,
                model.MealAllowanceTypeSettingID);
            return Json(true);
        }