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(); }
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)); }
public void ChangeStatus(ReportStatusType status) => Status = (int)status;
public bool IsStatus(ReportStatusType statusType) => Status == (int)statusType;