Ejemplo n.º 1
0
        public IActionResult AuditSort(AuditViewModel auditViewModel)
        {
            if (auditViewModel == null)
            {
                return(Redirect("Index"));
            }

            Audit audit = new Audit
            {
                FiscalYear = auditViewModel.FiscalYear,
            };

            IEnumerable <File> allFiles = _context.Files.Where(f => f.Status.Equals(Status.OK) || f.Status.Equals(Status.Damaged) || f.Status.Equals(Status.Full) || f.Status.Equals(Status.New))
                                          .Include(f => f.Consumer).Include(f => f.Room).OrderBy(f => f.Room.Name)
                                          .ThenBy(f => f.Consumer.LastName).ThenBy(f => f.Consumer.FirstName);

            List <List <File> > lists = audit.SortFiles(allFiles);

            audit.FirstQuarter  = lists[0];
            audit.SecondQuarter = lists[1];
            audit.ThirdQuarter  = lists[2];
            audit.FourthQuarter = lists[3];

            return(View(audit));
        }
Ejemplo n.º 2
0
        public IActionResult UpdateAudit([FromBody] AuditViewModel audit)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    AuditServiceResponseModel updateMethodServiceResponseModel = _iaudit.UpdateAuditService(audit);

                    if (updateMethodServiceResponseModel.code == responseCode.ErrorOccured)
                    {
                        return(BadRequest(updateMethodServiceResponseModel.audit, updateMethodServiceResponseModel.Message, updateMethodServiceResponseModel.code));
                    }
                    else if (updateMethodServiceResponseModel.code == responseCode.Successful)
                    {
                        return(Ok(updateMethodServiceResponseModel.audit, updateMethodServiceResponseModel.Message, updateMethodServiceResponseModel.code));
                    }
                    else
                    {
                        return(BadRequest(null, "Error Occured", responseCode.ErrorOccured));
                    }
                }
                return(BadRequest(null, "Null Entity", responseCode.ErrorOccured));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }
        public async Task <GeneralResponse> WriteLogAsync(AuditViewModel item, CancellationToken token = default(CancellationToken))
        {
            if (!item.IsValid())
            {
                return(new GeneralResponse
                {
                    Success = false,
                    Id = item.Id,
                    Messages = item.Validations
                });
            }

            await _repository.InsertAsync(new AuditViewModel().Map(item), token);

            var result = new GeneralResponse
            {
                Success  = true,
                Messages = new List <ResponseMessage>(
                    new List <ResponseMessage>
                {
                    new ResponseMessage
                    {
                        Status  = QueryStatus.Success,
                        Key     = "WriteLogAsync",
                        Message = Constants.Messages.CreatedSuccess
                    }
                })
            };

            return(result);
        }
Ejemplo n.º 4
0
        public JsonResult GetDetails()
        {
            var model = new AuditViewModel();
            var res   = model.GetAuditDetails();

            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public static AuditViewModel ToAuditViewModel(Audit audit)
        {
            var model = new AuditViewModel {
                AuditId      = audit.Id,
                AuditorId    = audit.AuditorId,
                AuditeeId    = audit.Inspection.InspectionSteps.Select(s => s.InspectorId).FirstOrDefault(),
                AuditorName  = audit.Auditor.FullName,
                AuditeeName  = audit.Inspection.InspectionSteps.Select(s => s.Inspector.FullName).FirstOrDefault(),
                AuditorTeams = audit.Auditor.Teams.Select(t => t.Name).ToList(),
                //AnomalyNumber = audit.Inspection.Anomalies.Count(anomalie => anomalie.Origin == AnomalyOrigin.Audit),
                AnomalyNumber = audit.AuditItems.Where(i => i.IsOk == false).Count(),
                SurveyId      = audit.SurveyId,
                SurveyName    = audit.Survey.Name,
                StartDate     = audit.StartDate.Date,
                EndDate       = audit.EndDate.HasValue ? audit.EndDate.Value.Date : audit.EndDate,
                IsOK          = audit.AuditItems.All(i => i.IsOk == true),
                InspectionId  = audit.InspectionId,
                ProcessName   = $"{audit.Inspection.Publication.Process.Label} (v{audit.Inspection.Publication.Version})",
                AuditItems    = audit.AuditItems.Select(i => new AuditItemViewModel
                {
                    AuditId  = i.AuditId,
                    Number   = i.Number,
                    Question = audit.Survey.SurveyItems.FirstOrDefault(s => s.Number == i.Number).Query,
                    IsOK     = i.IsOk,
                    Comment  = i.Comment,
                    HasPhoto = i.Photo != null,
                    Photo    = i.Photo == null ? null : string.Format("data:image/gif;base64,{0}", Convert.ToBase64String(i.Photo)),
                    RawPhoto = i.Photo == null ? "" : Convert.ToBase64String(i.Photo)
                }).ToList()
            };

            return(model);
        }
Ejemplo n.º 6
0
        public ActionResult Index(AuditViewModel audit)
        {
            var id    = auditTempRepository.Create(audit);
            var mlist = carManufactureRepository.GetList()
                        .Select(x => new SelectListItem
            {
                Text  = x.Title,
                Value = x.ID.ToString()
            }).ToList();

            mlist.Insert(0, new SelectListItem {
                Value = "", Text = "انتخاب نمایید"
            });
            ViewBag.CarManufacturerList = mlist;

            var list = cityRepository.GetList()
                       .Select(x => new SelectListItem
            {
                Text  = x.Title,
                Value = x.ID.ToString()
            }).ToList();

            list.Insert(0, new SelectListItem {
                Value = "", Text = "انتخاب نمایید"
            });
            ViewBag.CityList = list;
            return(RedirectToAction("Detail", new { id }));
        }
Ejemplo n.º 7
0
        public int Create(AuditViewModel audit)
        {
            var cmydr = new CarModelYearDetailRepository();
            var item  = new Audit()
            {
                CarManufactureID = audit.CarManufactureID,
                CarDetailID      = audit.CarDetailID,
                CarYearID        = audit.CarYearID,
                CarModelID       = audit.CarModelID,
                RequestDate      = PersianDateTime.Parse(audit.RequestDatePersian).ToDateTime(),
                FirstName        = audit.FirstName,
                LastName         = audit.LastName,
                Phone            = audit.Phone,
                Price            = cmydr.GetPrice(audit.CarModelID, audit.CarYearID, audit.CarDetailID),
                Email            = audit.Email,
                PaymentDate      = audit.PaymentDate,
                ReferID          = audit.ReferID,
                Authority        = audit.Authority,
                PaymentTypeID    = audit.PaymentTypeID,
                IsDone           = false,
                IsRead           = false
            };

            db.Audits.Add(item);
            db.SaveChanges();

            return(item.ID);
        }
 public ActionResult addCompanyBranch(AuditViewModel auditViewModel)
 {
     Session["ComplianceBranchID"] = auditViewModel.complianceAudit.Company_ID;
     Session["AuditorID"]          = auditViewModel.complianceAudit.Auditor_Id;
     Session["OrgHierID"]          = auditViewModel.complianceAudit.Org_Hier_Id;
     return(RedirectToAction("ListofVendors", new { branchid = auditViewModel.complianceAudit.Company_ID }));
 }
        /// <summary>
        /// 获取审核申请
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public AuditViewModel GetAuditResult(GetAuditResult request)
        {
            var            _year      = System.DateTime.Now.Year;
            AuditViewModel _auditview = new AuditViewModel();

            if (request.adcd != adcd)
            {
                throw new Exception("操作账号异常");
            }
            if (request.year.Value != _year)
            {
                throw new Exception("年份时间异常,申报年份仅限本年度");
            }
            using (var db = DbFactory.Open())
            {
                var builder = db.From <Model.Audit.Audit>();
                builder.LeftJoin <Model.Audit.Audit, AuditDetails>((x, y) => x.ID == y.AuditID);
                builder.Where(x => x.Year == request.year && x.TownADCD == request.adcd);
                builder.OrderByDescending <AuditDetails>(w => w.AuditTime);
                _auditview = db.Single <AuditViewModel>(builder);
                if (_auditview != null)
                {
                    _auditview.statusname = PublicClass.GetAudit(_auditview.Status, "");
                }
            }
            return(_auditview);
        }
Ejemplo n.º 10
0
        public ActionResult Index(AuditViewModel auditViewModel, int limit, int offset)
        {
            var temp = _cargoService.GetCargo(0, 0, 0, LoginUser.pk);

            var list = temp.OrderByDescending(u => u.CargoId).ToList();

            return(Json(new { total = list.Count, rows = list.Skip(offset).Take(limit).ToList() }));
        }
Ejemplo n.º 11
0
        //this service adds logs to the audit rail
        public AuditServiceResponseModel AuditCreationService(AuditViewModel audit)
        {
            try
            {
                //unit of work is used to replace _context.
                Audit_Rail auditToBeCreated;

                Company checkIfCompanyExists = UnitOfWork.GetRepository <Company>().Single(p => p.Id == audit.Company_Id && p.Status == EntityStatus.Active);
                if (checkIfCompanyExists != null)
                {
                    User checkIfUserExists = UnitOfWork.GetRepository <User>().Single(p => p.Id == audit.User_Id && p.Status == EntityStatus.Active);
                    if (checkIfUserExists != null)
                    {
                        auditToBeCreated = new Audit_Rail
                        {
                            Company_Id         = audit.Company_Id,
                            User_Id            = audit.User_Id,
                            Activity           = audit.Activity,
                            Status             = EntityStatus.Active,
                            CreatedAt          = DateTime.Now,
                            CreatedAtTimeStamp = DateTime.Now.ToTimeStamp(),
                            UpdatedAt          = DateTime.Now,
                            UpdatedAtTimeStamp = DateTime.Now.ToTimeStamp()
                        };
                        UnitOfWork.GetRepository <Audit_Rail>().Add(auditToBeCreated);
                        UnitOfWork.SaveChanges();

                        auditModel = new AuditServiceResponseModel()
                        {
                            audit = auditToBeCreated, Message = "Entity Created Successfully", code = responseCode.Successful
                        };
                        return(auditModel);
                    }
                    else
                    {
                        auditModel = new AuditServiceResponseModel()
                        {
                            audit = null, Message = "User Does Not Exist", code = responseCode.ErrorOccured
                        };
                        return(auditModel);
                    }
                }
                else
                {
                    auditModel = new AuditServiceResponseModel()
                    {
                        audit = null, Message = "Company Does Not Exist", code = responseCode.ErrorOccured
                    };
                    return(auditModel);
                }
            }
            catch (Exception ex)
            {
                _loggerManager.LogError(ex.Message);
                throw;
            }
        }
Ejemplo n.º 12
0
        public IActionResult Index()
        {
            var hj = new AuditViewModel
            {
                loadAllNpfChart = services.GetNpfChart(),
                loadAllYear     = loadAllYearIntoForm(services.GetDateInHistory())
            };

            return(View(hj));
        }
Ejemplo n.º 13
0
        public ActionResult Index(int?productionOrderId)
        {
            var auditViewModel = new AuditViewModel();

            if (productionOrderId != null)
            {
                auditViewModel.ProductOrderId = (int)productionOrderId;
            }

            return(View(auditViewModel));
        }
Ejemplo n.º 14
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            //Check if user logged in:
            if (HttpContext.Session.GetString("Username") == null)
            {
                return(Redirect("/Home/Login"));
            }

            AuditViewModel auditViewModel = new AuditViewModel();

            return(View(auditViewModel));
        }
Ejemplo n.º 15
0
        private async Task AssignAppNameToAuditRecord(AuditViewModel viewModel)
        {
            Guid?guid = GetTelemetryKeyFromUrl(viewModel.AreaAccessed);

            if (guid.HasValue)
            {
                string cacheKey = "AppName:" + guid.ToString();

                string name = (string)MemoryCache.Default.Get(cacheKey);
                if (string.IsNullOrEmpty(name))
                {
                    Program app = await this.unitOfWork.Programs.GetByTelemetryKey(guid.Value).ConfigureAwait(false);

                    name = app.Name;
                    MemoryCache.Default.Add(cacheKey, name, new CacheItemPolicy()
                    {
                        AbsoluteExpiration = DateTimeOffset.UtcNow.AddDays(1)
                    });
                }

                viewModel.Application = name;
                return;
            }

            guid = GetUpdatePackageGuidFromUrl(viewModel.AreaAccessed);
            if (guid.HasValue)
            {
                string cacheKey = "AppName:" + guid.ToString();

                string name = (string)MemoryCache.Default.Get(cacheKey);
                if (string.IsNullOrEmpty(name))
                {
                    ProgramUpdatePackageInfo packageInfo = await this.unitOfWork.UpdatePackages.GetUpdatePackageInfo(guid.Value).ConfigureAwait(false);

                    if (packageInfo != null)
                    {
                        Program app = await this.unitOfWork.Programs.GetByProgramId(packageInfo.ProgramId).ConfigureAwait(false);

                        if (app != null)
                        {
                            name = app.Name;
                            MemoryCache.Default.Add(cacheKey, name, new CacheItemPolicy()
                            {
                                AbsoluteExpiration = DateTimeOffset.UtcNow.AddDays(1)
                            });
                        }
                    }
                }

                viewModel.Application = name;
            }
        }
Ejemplo n.º 16
0
        public IActionResult Index()
        {
            string fundTypeCode = HttpContext.Session.GetString("fundtypecode");
            var    p            = fundService.GetFundTypeCodeByCode(fundTypeCode);
            int    y            = p.processingYear;

            var jk = new AuditViewModel
            {
                year = y.ToString()
            };

            return(View(jk));
        }
        public IActionResult balancesheetsandd() //balance sheet surplus and deficit
        {
            string fundTypeCode = HttpContext.Session.GetString("fundtypecode");
            var    p            = fundService.GetFundTypeCodeByCode(fundTypeCode);
            int    y            = p.processingYear;

            var jk = new AuditViewModel
            {
                year = y.ToString()
            };

            return(View(jk));
        }
Ejemplo n.º 18
0
        private async Task <List <AuditViewModel> > ToViewModel(List <Audit> data)
        {
            List <AuditViewModel> model = new List <AuditViewModel>();

            foreach (Audit audit in data)
            {
                AuditViewModel vm = AutoMapper.Mapper.Map <AuditViewModel>(audit);

                await this.AssignAppNameToAuditRecord(vm).ConfigureAwait(false);

                model.Add(vm);
            }
            return(model);
        }
Ejemplo n.º 19
0
        public void AddUpdateAuditSubject(AuditViewModel model, int LoggedInOrganizationId)
        {
            List <AuditSubject> _auditsubject = Mapper.Map <List <AuditSubjectViewModel>, List <AuditSubject> >(model.AuditSubjects);

            List <AuditSubject> storeAuditSubject = this.GetAllSubject(model.AuditID, LoggedInOrganizationId);

            foreach (var saudsub in storeAuditSubject)
            {
                bool isExist = _auditsubject.Any(x => x.AuditSubjectID == saudsub.AuditSubjectID);
                if (!isExist)
                {
                    saudsub.IsDeleted = true;
                    base.Update(saudsub);
                }
            }

            _auditsubject.ToList().ForEach(z =>
            {
                z.OrganizationID = LoggedInOrganizationId;

                if (z.AuditSubjectID > 0)
                {
                    AuditSubject storedAuditSubject        = this.GetSingle(z.AuditSubjectID, LoggedInOrganizationId);
                    storedAuditSubject.Subject             = z.Subject;
                    storedAuditSubject.AuditorID           = z.AuditorID;
                    storedAuditSubject.AuditeeID           = z.AuditeeID;
                    storedAuditSubject.Location            = z.Location;
                    storedAuditSubject.FrequencyRecurrence = z.FrequencyRecurrence;
                    storedAuditSubject.OrganizationID      = LoggedInOrganizationId;
                    base.Update(storedAuditSubject);
                    _IAuditSubjectQuestionRepository.AddUpdateAuditSubjectQuestion(z, LoggedInOrganizationId);
                }
                else
                {
                    z.AuditSubjectID = 0;
                    z.AuditSubjectQuestions.ToList().ForEach(x =>
                    {
                        x.AuditSubjectID         = 0;
                        x.AuditSubjectQuestionID = 0;
                    });
                    base.Insert(z);
                }
            });
            this._unitOfWork.Save();
            foreach (var z in _auditsubject)
            {
                GenerateAuditSubjectReview(z, model.DueDate);
            }
        }
Ejemplo n.º 20
0
        public ActionResult Add(AuditViewModel model)
        {
            var userId         = User.Identity.GetUserId();
            var submitDateTime = DateTime.Now;

            if (ModelState.IsValid)
            {
                model.AuditDateTime    = submitDateTime;
                model.AuditorId        = userId;
                model.ModifiedById     = userId;
                model.ModifiedDateTime = submitDateTime;
                model.SupervisorId     = _context.Users.Single(u => u.Id == model.AuditeeId).SupervisorId;

                var audit = new Audit();
                AutoMapper.Mapper.Map(model, audit);

                _context.Audits.Add(audit);
                _context.SaveChanges();

                var auditTemplate = _context.AuditTemplates
                                    .Include(a => a.Sections)
                                    .Single(a => a.Id == audit.AuditTemplateId);
                var auditResponses = new List <AuditResponse>();

                foreach (var section in auditTemplate.Sections)
                {
                    section.Elements = _context.AuditElements.Include(a => a.Choices).Where(a => a.SectionId == section.Id).ToList();
                    foreach (var element in section.Elements)
                    {
                        var auditResponse = new AuditResponse
                        {
                            AuditId   = audit.Id,
                            ElementId = element.Id,
                            ChoiceId  = element.Choices.OrderBy(e => e.Order).ToList()[0].Id
                        };
                        auditResponses.Add(auditResponse);
                    }
                }

                _context.AuditResponses.AddRange(auditResponses);
                _context.SaveChanges();

                return(RedirectToAction("Details", "Audits", new { id = audit.Id }));
            }

            model.Users = _context.Users.OrderBy(u => u.NameLastFirstMiddle).ToList();
            return(View("Form", model));
        }
Ejemplo n.º 21
0
        public ActionResult Add()
        {
            var viewModel = new AuditViewModel
            {
                Users = _context.Users
                        .OrderBy(u => u.NameLast)
                        .ThenBy(u => u.NameFirst)
                        .ThenBy(u => u.NameMiddle)
                        .ThenBy(u => u.UserName)
                        .ToList(),
                AuditTemplates = _context.AuditTemplates
                                 .Where(a => a.DeployDateTime.HasValue && a.DeployDateTime <= DateTime.Now && a.DepreciateDateTime == null || a.DepreciateDateTime > DateTime.Now).ToList()
            };

            return(View(viewModel));
        }
Ejemplo n.º 22
0
        public void Auditlogger(Guid company_Id, Guid user_Id, string activity)
        {
            AuditViewModel auditToBeCreated = new AuditViewModel
            {
                Company_Id         = company_Id,
                User_Id            = user_Id,
                Activity           = activity,
                Status             = EntityStatus.Active,
                CreatedAt          = DateTime.Now,
                CreatedAtTimeStamp = DateTime.Now.ToTimeStamp(),
                UpdatedAt          = DateTime.Now,
                UpdatedAtTimeStamp = DateTime.Now.ToTimeStamp()
            };

            _iaudit.AuditCreationService(auditToBeCreated);
        }
        public ActionResult PerformAudit([Bind(Include = "IdCode,Type")] PerformAuditViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index"));
            }

            AuditViewModel auditViewModel;

            if (model.Type == "ws")
            {
                WorkingStandard workingStandard = _uow.WorkingStandardRepository.Get().Where(w => w.IdCode == model.IdCode).FirstOrDefault();
                if (workingStandard == null)
                {
                    ViewBag.ErrorMessage = "The compound you have searched for was not found.";
                    return(View("Index"));
                }

                auditViewModel = new AuditViewModel {
                    ChemType = "WorkingStandard",
                    Id       = workingStandard.WorkingStandardId,
                    IdCode   = workingStandard.IdCode
                };
                auditViewModel.Parents = GetAllParents(workingStandard.PrepList.PrepListItems);
            }
            else if (model.Type == "is")
            {
                IntermediateStandard intermediatestandard = _uow.IntermediateStandardRepository.Get().Where(i => i.IdCode == model.IdCode).FirstOrDefault();
                if (intermediatestandard == null)
                {
                    ViewBag.ErrorMessage = "The compound you have searched for was not found.";
                    return(View("Index"));
                }
                auditViewModel = new AuditViewModel {
                    ChemType = "IntermediateStandard",
                    Id       = intermediatestandard.IntermediateStandardId,
                    IdCode   = intermediatestandard.IdCode
                };
                auditViewModel.Parents = GetAllParents(intermediatestandard.PrepList.PrepListItems);
            }
            else
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            return(View(auditViewModel));
        }
Ejemplo n.º 24
0
        public IActionResult Index()
        {
            var retrievedTime = DateTime.Now;
            var auditList     = _auditService.GetLatestAudits(_auditCount);
            var model         = new AuditViewModel()
            {
                AuditList = auditList.Select(a => new AuditEventViewModel()
                {
                    Id            = a.Id,
                    EventName     = a.Name ?? "No event name",
                    EventDetails  = a.Details ?? "No event details",
                    EventDateTime = a.CreatedTime
                }),
                RetrievedTime = retrievedTime
            };

            return(View(model));
        }
Ejemplo n.º 25
0
        public ActionResult Edit(AuditViewModel model)
        {
            if (ModelState.IsValid)
            {
                var now   = DateTime.Now;
                var audit = _auditService.GetById(model.Id);
                audit.ReasonForIssue = model.ReasonForIssue;
                audit.Notes          = model.Notes;
                audit.UpdatedBy      = _contextManager.UserManager.Name;
                audit.UpdatedDate    = now;

                _auditService.Update(audit);

                return(RedirectToAction("Index", "Audit"));
            }

            return(View("Edit", model));
        }
        public async Task <IActionResult> balancesheetsandd(AuditViewModel model)
        {
            var    result       = new List <LedgersView2>();
            string fundTypeCode = HttpContext.Session.GetString("fundtypecode");
            var    p            = fundService.GetFundTypeCodeByCode(fundTypeCode);
            int    m            = p.processingMonth;
            int    y            = p.processingYear;

            string fperiod    = model.year;
            string fundperiod = y.ToString();

            if (fperiod == fundperiod)
            {
                result = service.GetBalanceSheetSurplus_Deficit().ToList();
            }

            return(await generatePdf.GetPdf("Views/BalsheetReport/BalsheetReport_surplusndeficit.cshtml", result));
        }
Ejemplo n.º 27
0
        public void Given_new_viewmodel_CustomerAudits_should_not_be_null_and_IsLoading_should_be_false()
        {
            // arrange
            var mockServices        = new Mock <IServiceProxy>();
            var mockLogger          = new Mock <ILoggerFacade>();
            var mockEventAggregator = new Mock <IEventAggregator>();

            var fakeResult = Task.FromResult((IList <CustomerAudit>) new List <CustomerAudit>());

            mockServices.Setup(services => services.GetAllCustomerAudits()).Returns(fakeResult);

            // act
            var vm = new AuditViewModel(mockServices.Object, mockLogger.Object, mockEventAggregator.Object);

            // assert
            Assert.IsNotNull(vm.CustomerAudits);
            Assert.IsFalse(vm.IsLoading);
        }
Ejemplo n.º 28
0
        public ActionResult AddNewAudit(AuditViewModel model)
        {
            if (User == null)
            {
                return(null);
            }

            var addedCustomers = AuditManagement.AddNewAudit(_context, model.NumberOfAuditRecords, model.ServiceId);

            if (addedCustomers)
            {
                return(Json(new { status = "ok" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { status = "error", message = "No customers found" }, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 29
0
        public static string getOrderIdFromInvoice(AuditViewModel item, ApplicationDbContext db)
        {
            if (item.TableName == "Invoice")
            {
                Invoice invoice = db.Invoice.Where(x => x.InvoiceId.ToString() == item.KeyValue).FirstOrDefault();
                var     orderId = invoice != null?invoice.OrderId.ToString() : "0";

                return(orderId);
            }
            else if (item.TableName == "OtherCost")
            {
                OtherCost otherCost = db.OtherCost.Where(x => x.OtherCostId.ToString() == item.KeyValue).FirstOrDefault();
                var       orderId   = otherCost != null?otherCost.OrderId.ToString() : "0";

                return(orderId);
            }

            return(item.KeyValue);
        }
Ejemplo n.º 30
0
        public async Task <IActionResult> IndexAsync(LogsFilter filter = null)
        {
            if (filter == null)
            {
                filter = new LogsFilter();
            }
            if (filter.GuildId == 0)
            {
                filter.GuildId = DiscordClient.Guilds.FirstOrDefault()?.Id ?? 0;
            }

            var logs = await AuditService.GetAuditLogsAsync(filter);

            var pagination = await AuditService.GetPaginationInfoAsync(filter);

            var viewModel = new AuditViewModel(logs, filter, pagination, DiscordClient.Guilds.ToList());

            return(View(viewModel));
        }
Ejemplo n.º 31
0
 public AuditView( AuditViewModel auditViewModel )
     : this()
 {
     DataContext = auditViewModel;
 }