/// <summary> /// Set new info and reason /// </summary> /// <param name="reason"></param> /// <returns></returns> public BE.AbsenceReporting SetInfo(Trinity.BE.Reason reason) { var absenceModel = new Trinity.BE.AbsenceReporting(); absenceModel.ID = Guid.NewGuid(); absenceModel.AbsenceReason = reason.Value; absenceModel.ReasonDetails = reason.Detail; // set after scan document absenceModel.ScannedDocument = null; absenceModel.ReportingDate = DateTime.Now; return(absenceModel); }
public bool CreateAbsenceReporting(Trinity.BE.AbsenceReporting model, bool isLocal) { try { var absenceRepo = _localUnitOfWork.GetRepository <AbsenceReporting>(); AbsenceReporting dbAbsence = SetInfo(model); absenceRepo.Add(dbAbsence); _localUnitOfWork.Save(); return(true); } catch (Exception ex) { return(false); } }