/// <summary> /// insert machine time sheet by model /// </summary> /// <param name="model"></param> /// <returns></returns> public static TimeSheetMachineModel Create(TimeSheetMachineModel model) { // init var entity = new hr_TimeSheetMachine(); // fill model.FillEntity(ref entity); // create entity return(new TimeSheetMachineModel(hr_TimeSheetMachineService.Create(entity))); }
public TimeSheetCodeModel(hr_TimeSheetCode timeSheet) { // init object _timeSheetCode = timeSheet ?? new hr_TimeSheetCode(); // set props Init(_timeSheetCode); // get relation data _timeSheetMachine = hr_TimeSheetMachineService.GetById(_timeSheetCode.MachineId); _timeSheetMachine = _timeSheetMachine ?? new hr_TimeSheetMachine(); }