Ejemplo n.º 1
0
        protected override void Execute(CodeActivityContext context)
        {
            int id = ReportID.Get(context);
            ReportStatusType stat = Status.Get(context);

            var ctx    = new DAL.SwitchContext();
            var report = ctx.Switches.Where((r) => r.Id == id).SingleOrDefault();

            report.Status = (byte)stat;

            ctx.SaveChanges();
        }
Ejemplo n.º 2
0
        public async Task <bool> ChangeStatus(ReportStatusType reportStatusType, Report report)
        {
            if (report == null)
            {
                throw new EntityNotFoundException("Report not found");
            }

            report.ChangeStatus(reportStatusType);
            report.UpdateDate();

            return(await database.ReportRepository.Update(report));
        }
Ejemplo n.º 3
0
 public void ChangeStatus(ReportStatusType status) => Status = (int)status;
Ejemplo n.º 4
0
 public bool IsStatus(ReportStatusType statusType) => Status == (int)statusType;