public DashboardViewModel GetDataDashboard()
        {
            DashboardViewModel data = new DashboardViewModel();

            try
            {
                _uow.Open(DBConnection.BMIERP);

                var repo = new mstLogRepository(_uow);
                data.GetRequest    = repo.ReadByFilter(x => x.RequestMethod == "GET").ToList().Count();
                data.PutRequest    = repo.ReadByFilter(x => x.RequestMethod == "PUT").ToList().Count();
                data.PostRequest   = repo.ReadByFilter(x => x.RequestMethod == "POST").ToList().Count();
                data.DeleteRequest = repo.ReadByFilter(x => x.RequestMethod == "DELETE").ToList().Count();

                return(data);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                _uow.Dispose();
            }
        }
Example #2
0
        public void Save()
        {
            try
            {
                _uow.Open(DBConnection.BMIERP);
                _uow.BeginTransaction();

                var repo = new mstLogRepository(_uow);
                repo.Add(_mstLog);

                _uow.CommitTransaction();
            }
            catch (Exception)
            {
                _uow.RollbackTransaction();
            }
            finally
            {
                _uow.Dispose();
            }
        }
        public List <DashboardModel> GetDataChart()
        {
            List <DashboardModel> list = new List <DashboardModel>();
            DashboardModel        data = new DashboardModel();

            try
            {
                _uow.Open(DBConnection.BMIERP);

                var repo = new mstLogRepository(_uow);

                list = repo.GetAnotherDataforDashboard().ToList();

                return(list);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                _uow.Dispose();
            }
        }