public void NUnit_Domain_GetCatShift() { string status = string.Empty; Cat_ShiftServices service = new Cat_ShiftServices(); var count = service.GetAllUseEntity<Cat_ShiftEntity>(ref status); int count1 = count.Count(); Console.Write("Total Record: " + count1); }
public void NUnit_Domain_GetCatShift() { string status = string.Empty; Cat_ShiftServices service = new Cat_ShiftServices(); var count = service.GetAllUseEntity <Cat_ShiftEntity>(ref status); int count1 = count.Count(); Console.Write("Total Record: " + count1); }
public void NUnit_Domain_GetByIdCatShift() { string status = string.Empty; Cat_ShiftServices service = new Cat_ShiftServices(); var Shift = new Cat_Shift { Id = 2 }; var result = service.GetById<Cat_ShiftEntity>(Shift.Id, ref status) as Cat_ShiftEntity; NUnit.Framework.Assert.IsNotNull(result); Console.Write("SearchResult: " + result.Id + " | " + result.ShiftName + " | " + result.ShiftCode + " | " + result.InTime + " | " + result.CoOut + " | " + result.CoBreakIn + " | " + result.CoBreakOut); }
public void NUnit_Domain_GetByIdCatShift() { string status = string.Empty; Cat_ShiftServices service = new Cat_ShiftServices(); var Shift = new Cat_Shift { Id = 2 }; var result = service.GetById <Cat_ShiftEntity>(Shift.Id, ref status) as Cat_ShiftEntity; NUnit.Framework.Assert.IsNotNull(result); Console.Write("SearchResult: " + result.Id + " | " + result.ShiftName + " | " + result.ShiftCode + " | " + result.InTime + " | " + result.CoOut + " | " + result.CoBreakIn + " | " + result.CoBreakOut); }
public void NUnit_Domain_UpdateCatShift() { Cat_ShiftServices service = new Cat_ShiftServices(); var Shift = new Cat_Shift { Id = 12, ShiftName = "ABCDomain12", ShiftCode = "BC-12", }; string result = service.Edit(Shift); if (result != string.Empty) { Console.WriteLine("==>>> Result After Update: " + Shift.Id + " | " + Shift.ShiftName + " | " + Shift.ShiftCode + " | " + Shift.InTime + " | " + Shift.CoOut + " | " + Shift.CoBreakIn + " | " + Shift.CoBreakOut); } }
public void NUnit_Domain_DeleteCatShift() { Cat_ShiftServices service = new Cat_ShiftServices(); string result = string.Empty; int rs = 0; for (int i = 1; i <= 10; i++) { var Shift = new Cat_Shift { Id = i }; result = service.Delete<Cat_ShiftEntity>(Shift.Id); if (result != string.Empty) { rs += 1; Console.WriteLine("Process Success >>> Delete >>> " + i); } } Console.WriteLine("Total success record: " + rs); //NUnit.Framework.Assert.IsTrue(result); }
public void NUnit_Domain_DeleteEternityCatShift() { Cat_ShiftServices service = new Cat_ShiftServices(); string result = string.Empty; int rs = 0; for (int i = 1; i <= 10; i++) { var Shift = new Cat_Shift { Id = i }; result = service.Delete <Cat_ShiftEntity>(Shift.Id); if (result != string.Empty) { rs += 1; Console.Write(" Process Success >>> DeleteEternity >>> " + i); } } Console.WriteLine("Total success record: " + rs); //NUnit.Framework.Assert.IsTrue(result); }
public void NUnit_Domain_AddCatShift() { Cat_ShiftServices service = new Cat_ShiftServices(); string result = string.Empty; int rs = 0; for (int i = 0; i < 10; i++) { var Shift = new Cat_Shift { ShiftName = "NUnit Domain ShiftName " + i, ShiftCode = "NUnit-Code-" + i, }; result = service.Add(Shift); if (result != string.Empty) { rs += 1; Console.WriteLine("Process Success >>> Create >>> " + Shift.Id + " | " + Shift.ShiftName + " | " + Shift.ShiftCode + " | " + Shift.InTime + " | " + Shift.CoOut + " | " + Shift.CoBreakIn + " | " + Shift.CoBreakOut); } } Console.WriteLine("Total success record: " + rs); }
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 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; }
/// <summary> /// [Chuc.Nguyen] - 2014/05/30 /// Lấy danh sách loại nhân viên dùng cho các control có datasource trừ grid /// </summary> /// <returns></returns> //public JsonResult GetCostCentre() //{ // var service = new Cat_CostCentreServices(); // var result = service.Get().ToList().Translate<CatCostCentreModel>(); // return Json(result, JsonRequestBehavior.AllowGet); //} public JsonResult GetShift() { var service = new Cat_ShiftServices(); //var data = service.GetCatShift(); //var data = baseService.GetAllUseEntity<Cat_ShiftEntity>(ref _status); var data = baseService.GetDataNotParam<Cat_ShiftMultiEntity>(ConstantSql.hrm_cat_sp_get_Shift_multi, UserLogin, ref _status); var result = data.Select(item => new Cat_ShiftMultiEntity() { ID = item.ID, ShiftName = item.ShiftName, }); return Json(result, JsonRequestBehavior.AllowGet); }