Exemplo n.º 1
0
        public ActionResult DeleteAuditRequest(string id)
        {
            var requestRepo = new RequestRepo();

            requestRepo.DeleteMany(x => x.Id == id);
            return(View("AuditRequest"));
        }
Exemplo n.º 2
0
 public DriverController(SchedulRepo schdb, AddressRepo addb, RegionRepo regdb, RequestRepo reqdb)
 {
     this.schdb = schdb;
     this.addb  = addb;
     this.regdb = regdb;
     this.reqdb = reqdb;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Async call to authorize on MAIL.RU server.
 /// </summary>
 /// <returns>True or false result operation.</returns>
 public async Task <bool> LoginAsync()
 {
     if (!IsAnonymous)
     {
         Info = await RequestRepo.AccountInfo();
     }
     return(true);
 }
Exemplo n.º 4
0
        public List <ViewRequest> Get2(String id)
        {
            List <ViewRequest> l1 = new List <ViewRequest>();
            int did = Convert.ToInt32(id);

            l1 = new RequestRepo().ViewPendingRequest(did);

            return(l1);
        }
Exemplo n.º 5
0
        public ActionResult UpdateStatus(string id, int condition, string maintainerId)
        {
            var requestRepo = new RequestRepo();
            var ticket      = requestRepo.Get(id);
            var userRepo    = new UserRepo();
            var maintainer  = userRepo.Get(x => x.Id == maintainerId);

            ticket.Maintainer = maintainer.Name;
            ticket.Condition  = condition;
            requestRepo.Update(ticket);
            return(this.Json("true", JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
 public CommonController()
 {
     _cityRepo              = new CityRepo();
     _countyRepo            = new CountyRepo();
     _transfusionCenterRepo = new TransfusionCenterRepo();
     _requestRepo           = new RequestRepo();
     _profileRepo           = new ProfileRepo();
     _appointmentService    = new DonationAppointmentService(new DonationAppointmentRepo());
     _bloodTypeService      = new BloodTypeService(new BloodTypeRepo());
     _notificationService   = new NotificationService();
     _labResultService      = new LabResultService(new LabResultRepo());
     _donationService       = new DonationService(new DonationRepo());
 }
Exemplo n.º 7
0
        public void Setup()
        {
            _testRequestId = Guid.NewGuid().ToString();
            _requestRepo   = RequestRepo.Instance;
            var config = new Configuration
            {
                BaseUrl  = WebApiSetupFixture.BaseAddress,
                Advanced =
                {
                    WebrequestModifier = w => w.Headers.Add("X-Request-Id",  _testRequestId),
                    Credentials        = new NetworkCredential("pardahlman", "password")
                }
            };

            _client = new HttpClient(config);
        }
Exemplo n.º 8
0
 public ThingController(ILogger <ThingController> logger)
 {
     _logger     = logger;
     repo        = new ThingRepo();
     requestRepo = new RequestRepo();
 }
 public FeatureController()
 {
     _xmlSerializer  = new DefaultXmlSerializer();
     _jsonSerializer = new DefaultJsonSerializer();
     _requestRepo    = RequestRepo.Instance;
 }
 public RequestController(RequestRepo Req)
 {
     this.Req = Req;
 }
Exemplo n.º 11
0
        public dynamic Index(AlexaRequest alexaRequest)
        {
            var totalSecons = (DateTime.UtcNow - alexaRequest.Request.Timestamp).TotalSeconds;
            //if (totalSecons < 0 || totalSecons > 150)
            //{
            //    log.Error("Someone tried to hack you");
            //    throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.BadRequest));
            //}

            var request = new Request
            {
                MemberId    = alexaRequest.Session.Attributes?.MemberId ?? 0,
                Timestamp   = alexaRequest.Request.Timestamp,
                Intent      = (alexaRequest.Request.Intent == null) ? "" : alexaRequest.Request.Intent.Name,
                AppId       = alexaRequest.Session.Application.ApplicationId,
                RequestId   = alexaRequest.Request.RequestId,
                SessionId   = alexaRequest.Session.SessionId,
                UserId      = alexaRequest.Session.User.UserId,
                IsNew       = alexaRequest.Session.New,
                Version     = alexaRequest.Version,
                Type        = alexaRequest.Request.Type,
                Reason      = alexaRequest.Request.Reason,
                SlotsList   = alexaRequest.Request.Intent?.GetSlots(),
                Slots       = alexaRequest.Request.Intent?.Slots,
                DateCreated = DateTime.UtcNow,
                CardTitle   = CardTitle,
                Accesstoken = alexaRequest.Session.User.AccessToken
            };

            if (alexaRequest.Context.System.User.Permissions == null)
            {
                return(AskTheUserToGiveConsent(alexaRequest));
            }

            var repo = new RequestRepo(request);

            repo.Insert();



            if (alexaRequest.Session.User.AccessToken == null)
            {
                log.Info("User " + request.UserId + " Was not logged in with google");
                return(AskTheUserToauthenticate(alexaRequest));
            }


            AlexaResponse response = new AlexaResponse();

            switch (request.Type)
            {
            case "LaunchRequest":
                response = LaunchRequestHandler(request);
                break;

            case "IntentRequest":
                response = IntentRequestHandler(request);
                break;

            case "SessionEndedRequest":
                response = SessionEndedRequestHandler(request);
                break;
            }

            return(response);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Async call to authorize on MAIL.RU server.
        /// </summary>
        /// <returns>True or false result operation.</returns>
        public async Task <bool> LoginAsync()
        {
            Info = await RequestRepo.AccountInfo();

            return(true);
        }
Exemplo n.º 13
0
 public RequestController(RequestRepo requestRepo)
 {
     _requestRepo = requestRepo;
 }