public ReturnVM Create(TemporaryClassBase model) { var result = new ReturnVM(); try { var entity = new TemporaryClass { Date = model.Date, Times = model.Times, Classroom = model.Classroom, Sections = model.Sections, Remark = model.Remark, AddedOn = DateTime.Now }; _repository.Create(entity); result.Message = entity.Id.ToString(); result.IsSuccess = true; } catch (Exception ex) { result.Message = ex.Message; } return(result); }
public MainWindow() { InitializeComponent(); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(HandleUnhandledError); TemporaryClass.Run(); Application.Current.Shutdown(); }
protected TemporaryClassView ConvertToViewModel(TemporaryClass entity) => new TemporaryClassView { Id = entity.Id, Date = entity.Date, Classroom = entity.Classroom, Sections = entity.Sections, AddedOn = entity.AddedOn, Remark = entity.Remark };
public ReturnVM Delete(long id) { var result = new ReturnVM(); try { var entity = new TemporaryClass { Id = id }; _repository.Delete(entity); result.IsSuccess = true; } catch (Exception ex) { result.Message = ex.Message; } return(result); }