public DataSet GetmprstatusReport(ReportInputModel model) { DataSet ds = new DataSet(); SqlParameter[] Param = new SqlParameter[5]; string data = ""; YSCMEntities obj = new YSCMEntities(); if (model.OrgDepartmentId != 0) { List <int> departments = obj.MPRDepartments.Where(x => x.ORgDepartmentid == model.OrgDepartmentId).Select(x => (int)x.DepartmentId).ToList(); data = string.Join(" , ", departments); } if (model.BuyerGroupId == 0) { Param[0] = new SqlParameter("buyergroupid", SqlDbType.VarChar); Param[0].Value = DBNull.Value; Param[1] = new SqlParameter("@fromdate", model.Fromdate); Param[2] = new SqlParameter("@todate", model.Todate); Param[3] = new SqlParameter("@DepartmentId", data); Param[4] = new SqlParameter("@issuepurpose", model.Issuepurposeid); } else { //string region = (string.Join(",", model.multiregion.Select(x => x.Region.ToString()).ToArray())); Param[0] = new SqlParameter("@BuyerGroupId", model.BuyerGroupId); Param[1] = new SqlParameter("@fromdate", model.Fromdate); Param[2] = new SqlParameter("@todate", model.Todate); Param[3] = new SqlParameter("@DepartmentId", data); Param[4] = new SqlParameter("@issuepurpose", model.Issuepurposeid); } ds = _paBusenessAcess.GetmprstatusReport("newmprstatuareport", Param); return(ds); }
public IHttpActionResult LoadprojectDurationwisereport(ReportInputModel model) { List <ReportbyprojectDuration> status = new List <ReportbyprojectDuration>(); status = _paBusenessAcess.LoadprojectDurationwisereport(model); return(Ok(status)); }
public IActionResult Report(string courseId) { var viewModel = new ReportInputModel { CourseId = courseId, }; return(this.View(viewModel)); }
public async Task CreateReport(ReportInputModel input) { await this.reportRepository.AddAsync(new Report { Content = input.Content, Subject = input.Subject, PostId = int.Parse(input.PostId), }); await this.reportRepository.SaveChangesAsync(); }
// GET: AdmiralsQuarters/Broadcast public ActionResult Index(ReportInputModel model) { var allShards = this.Cache.Get<IEnumerable<SimpleShardViewModel>>( "AllShards", () => this.shardService.GetShards() .ProjectTo<SimpleShardViewModel>() .ToList(), 60 * 60); ViewBag.Shards = allShards; return View(model); }
public async Task <IActionResult> Report(ReportInputModel inputModel) { if (!this.ModelState.IsValid) { return(this.View(inputModel)); } var userId = this.userManager.GetUserId(this.User); await this.reportsService.CreateReportAsync(inputModel.Title, inputModel.Description, inputModel.CourseId, userId); return(this.RedirectToAction("EnrolledCourses")); }
public IActionResult Report([FromBody] ReportInputModel model) { try { var messageResponse = this.reportService.Store(model); return(this.Ok(messageResponse)); } catch (Exception e) { return(this.BadRequest(e.Message)); } }
public IActionResult ReportPost(ReportInputModel inputModel) { if (!this.ModelState.IsValid) { return(this.View()); } var post = this.postService.GetPostById(inputModel.Id); var reporter = this.userService.GetUserByName(this.User.Identity.Name); this.reportService.CreateReport(inputModel.ReportReason, post.Id, post.UserId, reporter.Id); return(this.RedirectToAction("Index", "Home")); }
public async Task <ReportOutputModel> Report([FromBody] ReportInputModel input) { try { var transactions = await _mobileTransactionRepository.GetAll().Where(x => x.CivilId == input.CivilId & x.TransDate.Date >= input.FromDate.Date & x.TransDate.Date <= input.ToDate.Date).OrderByDescending(x => x.TransDate.Date).ToListAsync(); if (transactions.Count == 0) { return(new ReportOutputModel { Status = false, Message = (input.LanguaugeId == 1) ? "لا يوجد بصمات" : "No Transactions Found" }); } List <TransEntityModel> model = new List <TransEntityModel>(); var result = transactions; DateTime tempdate = DateTime.Now.AddDays(1); foreach (var item in result) { if (item.TransDate.Date != tempdate.Date) { var lst = transactions.Where(x => x.TransDate.Date == item.TransDate.Date).ToList(); TransEntityModel report = new TransEntityModel { TransDate = item.TransDate.Date, Transactions = ObjectMapper.Map <List <ReportEntityModel> >(lst) }; model.Add(report); } tempdate = item.TransDate.Date; } return(new ReportOutputModel { Status = true, Transactions = model }); } catch (Exception ex) { return(new ReportOutputModel { Status = false, Message = ex.Message }); } }
public ReportInputModel Store(ReportInputModel model) { this.CheckModelForNull(model); var report = new Report { Message = model.Message, UserId = model.UserId }; this.Data.Reports.Add(report); this.Data.SaveChanges(); return(model); }
public async Task <ReportInputModel> CreateAsync(string reportedUserId, string senderId) { var reportedUserUsername = await this.usersService.GetUserNameByUserIdAsync(reportedUserId); var senderUserName = await this.usersService.GetUserNameByUserIdAsync(senderId); var viewModel = new ReportInputModel { ReportedUserId = reportedUserId, ReportedUserUserName = reportedUserUsername, SenderUserId = senderId, SenderUserName = senderUserName, }; return(viewModel); }
public async Task <GetEmpLocationsOutputModel> GetEmpLocations([FromBody] ReportInputModel input) { try { List <LocationModel> model = new List <LocationModel>(); var user = await _userManager.Users.Include(x => x.Locations).Where(x => x.CivilId == input.CivilId).FirstOrDefaultAsync(); var locations = user.Locations.Where(x => x.ToDate.Date >= DateTime.Now.Date); foreach (var item in locations) { var location = _locationRepository.GetAll().Where(x => x.Id == item.LocationId).FirstOrDefault(); LocationModel locationmodel = new LocationModel { Siteid = item.LocationId, SiteName = location.TitleAr, FromDate = item.FromDate, ToDate = item.FromDate }; var crds = _locationCredentialRepository.GetAll().Where(x => x.LocationId == item.LocationId); List <LocationCerdentialModel> cerdentiallist = new List <LocationCerdentialModel>(); foreach (var crd in crds) { cerdentiallist.Add(new LocationCerdentialModel { lat = crd.Latitude, lon = crd.Longitude }); } locationmodel.cerdentials = cerdentiallist; model.Add(locationmodel); } if (locations.Count() > 0) { return(new GetEmpLocationsOutputModel { Status = true, locations = model }); } else { return(new GetEmpLocationsOutputModel { Status = false, Message = (input.LanguaugeId == 1) ? "لا يوجد مواقع متاحة للبصمة" : "No Locations Avaliable" }); } } catch (Exception ex) { return(new GetEmpLocationsOutputModel { Status = false, Message = ex.Message }); } }
public async Task <ActionResult <CreateReportOutputModel> > Create(ReportInputModel input) { var reporter = await this.reporters.FindByUser(this.currentUser.UserId); var pet = await this.pets.Find(input.Pet.Id); if (pet == null) { return(BadRequest(Result.Failure("Pet does not exist."))); } pet = new Pet { PetType = input.Pet.PetType, Name = input.Pet.Name, Age = input.Pet.Age, RFID = input.Pet.RFID, PetDescription = input.Pet.PetDescription }; var location = await this.locations.FindByLongAndLat(input.Location.Latitude, input.Location.Longitude); location ??= new Location { Address = input.Location.Address, Longitude = input.Location.Longitude, Latitude = input.Location.Latitude }; var report = new Report { Status = input.Status, LostDate = input.LostDate, ImagesLinksPost = input.ImagesLinksPost, RewardSum = input.RewardSum, Location = location, Pet = pet, IsApproved = false }; await this.reports.Save(report); return(new CreateReportOutputModel(report.Id)); }
public DataSet GetMprstatuswisereport(ReportInputModel model) { DataSet ds = new DataSet(); SqlParameter[] Param = new SqlParameter[7]; string data = ""; YSCMEntities obj = new YSCMEntities(); if (model.DepartmentId == 0) { List <int> departments = obj.MPRDepartments.Where(x => x.ORgDepartmentid == model.OrgDepartmentId).Select(x => (int)x.DepartmentId).ToList(); data = string.Join(" , ", departments); } else { data = string.Join(",", model.DepartmentId); } if (model.BuyerGroupId == 0) { Param[0] = new SqlParameter("buyergroupid", SqlDbType.VarChar); Param[0].Value = DBNull.Value; Param[1] = new SqlParameter("@fromdate", model.Fromdate); Param[2] = new SqlParameter("@todate", model.Todate); Param[3] = new SqlParameter("@ProjectManager", model.ProjectManager); Param[4] = new SqlParameter("@SaleOrderNo", model.SaleOrderNo); Param[5] = new SqlParameter("@Departmentid", data); Param[6] = new SqlParameter("@JobCode", model.jobcode); } else { //string region = (string.Join(",", model.multiregion.Select(x => x.Region.ToString()).ToArray())); Param[0] = new SqlParameter("@BuyerGroupId", model.BuyerGroupId); Param[1] = new SqlParameter("@fromdate", model.Fromdate); Param[2] = new SqlParameter("@todate", model.Todate); Param[3] = new SqlParameter("@ProjectManager", model.ProjectManager); Param[4] = new SqlParameter("@SaleOrderNo", model.SaleOrderNo); Param[5] = new SqlParameter("@Departmentid", data); Param[6] = new SqlParameter("@JobCode", model.jobcode); } ds = _paBusenessAcess.GetMprstatuswisereport("Mprwisereport", Param); return(ds); }
public async Task <ActionResult> Edit(int id, ReportInputModel input) { var reporterId = await this.reporters.GetIdByUser(this.currentUser.UserId); var reporterHasReport = await this.reporters.HasReports(reporterId, id); if (!reporterHasReport) { return(BadRequest(Result.Failure("You cannot edit this ."))); } var pet = await this.pets.Find(input.Pet.Id); var location = await this.locations.FindByLongAndLat(input.Location.Latitude, input.Location.Longitude); location ??= new Location { Address = input.Location.Address, Longitude = input.Location.Longitude, Latitude = input.Location.Latitude }; var report = await this.reports.Find(id); report.Location = location; report.Status = input.Status; report.Pet = pet; report.ImagesLinksPost = input.ImagesLinksPost; report.RewardSum = input.RewardSum; await this.reports.Save(report); await this.publisher.Publish(new ReportUpdateMessage { ReportId = report.Id, Status = report.Status }); return(Result.Success); }
public ActionResult Broadcast(ReportInputModel model) { if (!ModelState.IsValid) { var allShards = this.Cache.Get<IEnumerable<SimpleShardViewModel>>( "AllShards", () => this.shardService.GetShards() .ProjectTo<SimpleShardViewModel>() .ToList(), 60 * 60); ViewBag.Shards = allShards; return View("Index", model); } this.SetSuccessMessage("The message will be sent out to all players in the shard."); var report = Mapper.Map<Report>(model); BackgroundJob.Enqueue<IReportsService>(rs => rs.BroadcastToShard(model.ShardId, report)); return RedirectToAction("Index"); }
public async Task <IActionResult> ReportPost([FromBody] ReportInputModel model) { await this.reportService.CreateReport(model); return(this.Json(true)); }
public IHttpActionResult GetmprRequisitionReport(ReportInputModel input) { return(Ok(this._paBusenessAcess.GetmprRequisitionReport(input))); }
public IHttpActionResult Loadprojectcodewisereport(ReportInputModel model) { //List<Reportbyprojectcode> status = new List<Reportbyprojectcode>(); // status = _paBusenessAcess.Loadprojectcodewisereport(model); return(Ok(_paBusenessAcess.Loadprojectcodewisereport(model))); }
public List <RequisitionReport> GetmprRequisitionReport(ReportInputModel input) { return(_purchaseDataAcess.GetmprRequisitionReport(input)); }
public List <ReportbyprojectDuration> LoadprojectDurationwisereport(ReportInputModel model) { return(_purchaseDataAcess.LoadprojectDurationwisereport(model)); }
public DataTable Loadprojectcodewisereport(ReportInputModel model) { return(_purchaseDataAcess.Loadprojectcodewisereport(model)); }