Exemple #1
0
        /// <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);
        }
Exemple #2
0
 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);
     }
 }