示例#1
0
        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);
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(HandleUnhandledError);
            TemporaryClass.Run();

            Application.Current.Shutdown();
        }
示例#3
0
 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
 };
示例#4
0
        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);
        }