Esempio n. 1
0
        public ActionResult Ajindex(string orderBy, string order, string startDate, string endDate, string cboUser, string cboPro)
        {
            AuditLogModels viewerModels = null;

            try
            {
                MyClinic.Infrastructure.Log log = new MyClinic.Infrastructure.Log();
                orderBy = orderBy.Replace(" ", "") ?? Common.defaultOrderBy;
                order   = order ?? Common.defaultListOrder;
                int totalRecords = 0;
                var lstRecords   = logRepository.Search(startDate, endDate, cboUser, cboPro, orderBy, order, out totalRecords);
                viewerModels = new AuditLogModels()
                {
                    lstRecords   = lstRecords,
                    order        = order,
                    orderBy      = orderBy,
                    totalRecords = totalRecords,
                    startDate    = startDate,
                    endDate      = endDate,
                    cboPro       = cboPro,
                    cboUser      = cboUser
                };
            }
            catch (Exception ex)
            {
                log.Error(ex);
                ModelState.AddModelError("error", Translator.UnexpectedError);
            }
            return(View("Ajindex", "_LayoutBlank", viewerModels));
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            try
            {
                MyClinic.Infrastructure.Log log = new MyClinic.Infrastructure.Log();
                var    objSession   = Session["user"] as MyClinic.Infrastructure.SessUser;
                var    idLogUser    = objSession.UserId;
                string searchBy     = "";
                string keyword      = "";
                var    orderBy      = Common.defaultOrderBy;
                var    order        = Common.defaultListOrder;
                var    _pageNo      = 1;
                var    _pageSize    = 10;
                var    _pageStatus  = 1;
                var    totalRecords = 0;
                //var logs = logRepository.Search(searchBy, keyword, orderBy, order, _pageNo, _pageSize, out totalRecords);
                var logs        = logRepository.SearchInLogUser(searchBy, keyword, orderBy, order, _pageNo, _pageSize, out totalRecords, idLogUser);
                var listResult  = Paging.GetResultInfo(totalRecords, _pageNo, _pageSize);
                var paging      = Paging.GetPaging(totalRecords, _pageNo, _pageSize, _pageStatus, Common.defaultNoOfPageLinkList, "$managelog.pagingManageRecords", orderBy, order);
                var itemPerPage = Paging.getItemPerPage(totalRecords, _pageSize, orderBy, order, "$managelog.itemPerPageChangeLogByDate");

                var           lstProcessTypes = auditLogRepository.GetProcessType();
                var           lstUsers        = userRepository.Get();
                string        cboPro          = "";
                string        startDate       = "";
                string        endDate         = "";
                PageUtilities pageUtilities   = new PageUtilities()
                {
                    listHeader = listResult,
                    listFooter = paging + itemPerPage,
                    order      = order,
                    orderBy    = orderBy,
                };
                logModels = new LogModels
                {
                    logRecords      = logs,
                    pageUtilities   = pageUtilities,
                    lstProcessTypes = lstProcessTypes,
                    lstUsers        = lstUsers,
                    startDate       = startDate,
                    endDate         = endDate,
                    cboPro          = cboPro,
                };
            }
            catch (Exception ex)
            {
                log.Error(ex);
                ModelState.AddModelError("error", Translator.UnexpectedError);
            }
            return(View(logModels));
        }
Esempio n. 3
0
 public ActionResult AjindexSearchByDate(string orderBy, string order, string startDate, string endDate, string cboUser, string cboPro, int?pageNo, int?pageSize, int?pageStatus)
 {
     try
     {
         var _pageNo     = pageNo ?? 1;
         var _pageSize   = pageSize ?? Common.defaultPageSize;
         var _pageStatus = pageStatus ?? 1;
         MyClinic.Infrastructure.Log log = new MyClinic.Infrastructure.Log();
         orderBy = orderBy.Replace(" ", "") ?? Common.defaultOrderBy;
         order   = order ?? Common.defaultListOrder;
         int           totalRecords  = 0;
         var           lstRecords    = logRepository.SearchByDate(startDate, endDate, cboUser, cboPro, orderBy, order, out totalRecords, _pageNo, _pageSize);
         var           listResult    = Paging.GetResultInfo(totalRecords, _pageNo, _pageSize);
         var           paging        = Paging.GetPaging(totalRecords, _pageNo, _pageSize, _pageStatus, Common.defaultNoOfPageLinkList, "$managelog.pagingManageRecords", orderBy, order);
         var           itemPerPage   = Paging.getItemPerPage(totalRecords, _pageSize, orderBy, order, "$managelog.itemPerPageChangeLogByDate");
         PageUtilities pageUtilities = new PageUtilities()
         {
             listHeader = listResult,
             listFooter = paging + itemPerPage,
             order      = order,
             orderBy    = orderBy
         };
         logModels = new LogModels
         {
             logRecords    = lstRecords,
             order         = order,
             orderBy       = orderBy,
             totalRecords  = totalRecords,
             startDate     = startDate,
             endDate       = endDate,
             cboPro        = cboPro,
             cboUser       = cboUser,
             pageUtilities = pageUtilities,
         };
     }
     catch (Exception ex)
     {
         log.Error(ex);
         ModelState.AddModelError("error", Translator.UnexpectedError);
     }
     return(View("AjindexSearchByDate", "_LayoutBlank", logModels));
 }
Esempio n. 4
0
        public ActionResult Index()
        {
            AuditLogModels viewerModels = null;

            try
            {
                MyClinic.Infrastructure.Log log = new MyClinic.Infrastructure.Log();
                var    objCurDate      = DateTime.Today;
                var    objPreDate      = objCurDate.AddDays(-1);
                string startDate       = Common.GetDatePickerDisplay(objPreDate);
                string endDate         = Common.GetDatePickerDisplay(objCurDate);
                string cboUser         = "";
                string cboPro          = "";
                var    orderBy         = Common.defaultOrderBy;
                var    order           = Common.defaultListOrder;
                var    totalRecords    = 0;
                var    lstProcessTypes = logRepository.GetProcessType();
                var    lstUsers        = userRepository.Get();
                var    lstRecords      = logRepository.Search(startDate, endDate, cboUser, cboPro, orderBy, order, out totalRecords);
                viewerModels = new AuditLogModels()
                {
                    lstRecords      = lstRecords,
                    lstUsers        = lstUsers,
                    lstProcessTypes = lstProcessTypes,
                    order           = order,
                    orderBy         = orderBy,
                    totalRecords    = totalRecords,
                    startDate       = startDate,
                    endDate         = endDate,
                    cboPro          = cboPro,
                    cboUser         = cboUser
                };
            }
            catch (Exception ex) {
                log.Error(ex);
            }
            return(View(viewerModels));
        }