public void NUnit_WorkDay_Domain_Add()
        {
            Att_WorkDayServices service = new Att_WorkDayServices();
            string result  = string.Empty;
            int    countSC = 0;

            for (int i = 1; i <= 10; i++)
            {
                var model = new Att_WorkDay
                {
                    ProfileID    = 1,
                    WorkDate     = DateTime.Parse("10-05-14"),
                    FirstInTime  = DateTime.Parse("10-05-14 08:00:00"),
                    LastOutTime  = DateTime.Parse("10-05-14 23:00:00"),
                    WorkDuration = 15
                };
                result = service.Add(model);
                if (result != string.Empty)
                {
                    countSC += 1;
                    Console.WriteLine("Process Success >>> Create >>> " + model.Id
                                      );
                }
            }
            Console.WriteLine("Total success record: " + countSC);
        }
        public void NUnit_WorkDay_Domain_Get()
        {
            Att_WorkDayServices service = new Att_WorkDayServices();
            string status = string.Empty;
            var    repo   = service.GetAllUseEntity <Att_WorkDayEntity>(ref status);

            Console.Write("Total Record: " + repo.Count());
        }
Example #3
0
        /// <summary>
        /// [Son.Vo] - Xóa hoặc chuyển đổi trạng thái của Lịch Sử Thẻ(Att_WorkDay) sang IsDelete
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Att_WorkdayModel DeleteOrRemove(Guid id)
        {
            //ActionService service = new ActionService(UserLogin);
            //var result = service.DeleteOrRemove<Att_WorkdayEntity, Att_WorkdayModel>(id);
            //return result;
            Att_WorkDayServices service = new Att_WorkDayServices();
            var result = service.Remove <Att_WorkdayEntity>(id);

            //return result;
            return(new Att_WorkdayModel());
        }
        public void NUnit_WorkDay_Domain_Delete()
        {
            Att_WorkDayServices service = new Att_WorkDayServices();
            int rs    = 0;
            var model = new Att_WorkDay {
                Id = 3
            };
            string result = service.Delete <Att_WorkDayEntity>(model.Id);

            if (result != string.Empty)
            {
                rs += 1;
                Console.WriteLine("Process Success >>> Delete >>> " + model.Id);
            }
        }
Example #5
0
        //SonVo - 20140617 - chuyển thành trạng thái Sumit
        public ActionResult SubmitWorkDay(string selectedIds)
        {
            List <Guid> ids = new List <Guid>();

            if (selectedIds != null)
            {
                ids = selectedIds
                      .Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                      .Select(x => new Guid(x))
                      .ToList();
            }
            Att_WorkDayServices service = new Att_WorkDayServices();

            service.SubmitWorkDay(ids);

            return(Json(""));
        }
        public void NUnit_WorkDay_Domain_Edit()
        {
            Att_WorkDayServices service = new Att_WorkDayServices();
            var model = new Att_WorkDay
            {
                Id        = 5,
                ProfileID = 1
            };
            string result = service.Edit(model);

            if (result != string.Empty)
            {
                Console.WriteLine("Process Success >>> Update >>> " + model.Id
                                  + " | " + model.ProfileID
                                  + " | " + model.WorkDate
                                  );
            }
        }
        public IEnumerable <Att_OvertimeModel> Post(Att_ComputeOvertimeModel model)
        {
            Att_WorkDayServices serviceWorkDay = new Att_WorkDayServices();
            var status     = string.Empty;
            var lstWorkDay = serviceWorkDay.GetWorkDaysByInOut(model.DateFrom, model.DateTo);
            Cat_ShiftServices serviceShift = new Cat_ShiftServices();
            var lstShift = serviceShift.GetDataNotParam <Cat_ShiftEntity>(ConstantSql.hrm_cat_sp_get_Shift, UserLogin, ref status);

            //Cat_ShiftItemServices serviceShiftItem = new Cat_ShiftItemServices();
            //var lstShiftItem = serviceShiftItem.GetCatShiftItem();
            var lstShiftItem = new List <Cat_ShiftItemEntity>();
            Cat_DayOffServices servicesDayOff = new Cat_DayOffServices();
            var lstDayOff = servicesDayOff.GetAllUseEntity <Cat_DayOffEntity>(ref status).ToList();

            Cat_OvertimeTypeServices servicesOvertimeType = new Cat_OvertimeTypeServices();
            var lstOvertimeType = servicesOvertimeType.GetDataNotParam <Cat_OvertimeTypeEntity>(ConstantSql.hrm_cat_sp_get_OvertimeType, UserLogin, ref status);

            var Att_OvertimeInfoFillterAnalyze = new Att_OvertimeInfoFillterAnalyze()
            {
                isAllowGetAfterShift           = model.isAllowGetAfterShift,
                isAllowGetBeforeShift          = model.isAllowGetBeforeShift,
                isAllowGetInShift              = model.isAllowGetInShift,
                isAllowGetOTOutterShift        = model.isAllowGetOTOutterShift,
                isAllowGetTypeBaseOnActualDate = model.isAllowGetTypeBaseOnActualDate,
                isAllowGetTypeBaseOnBeginShift = model.isAllowGetTypeBaseOnBeginShift,
                isAllowGetTypeBaseOnEndShift   = model.isAllowGetTypeBaseOnEndShift,
                MininumOvertimeHour            = model.MininumOvertimeHour
            };

            var service = new Att_OvertimeServices();
            var result  = service.AnalyzeOvertime(lstWorkDay,
                                                  lstShift,
                                                  lstShiftItem,
                                                  lstDayOff,
                                                  lstOvertimeType,
                                                  Att_OvertimeInfoFillterAnalyze, UserLogin).ToList().Translate <Att_OvertimeModel>();

            return(result);
        }
        public void NUnit_WorkDay_Domain_GetById()
        {
            string status = string.Empty;
            Att_WorkDayServices service = new Att_WorkDayServices();
            var model = new Att_WorkDay {
                Id = 3
            };
            var result = service.GetById <Att_WorkDayEntity>(model.Id, ref status) as Att_WorkDayEntity;

            NUnit.Framework.Assert.IsNotNull(result);
            Console.Write("SearchResult: " + result.Id
                          + " | " + result.ProfileID
                          + " | " + result.WorkDate
                          + " | " + result.FirstInTime
                          //+ " | " + result.FirstOutTime
                          //+ " | " + result.LastInTime
                          + " | " + result.LastOutTime
                          + " | " + result.WorkDuration
                          + " | " + result.EarlyDuration1
                          + " | " + result.LateDuration1
                          + " | " + result.LateEarlyDuration
                          );
        }