Esempio n. 1
0
        public HttpResponseMessage TurnsCancellation()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClientApikeyNoncePersonalNonceWith2Parameter(Request, ATISMobileWebApiLogTypes.WebApiClientTurnsCancellation);

                var NSSSoftwareuser        = WebAPi.GetNSSSoftwareUser(Request);
                var InstanceConfiguration  = new R2CoreInstanceConfigurationManager();
                var InstanceSoftwareusers  = new R2CoreInstanseSoftwareUsersManager();
                var InstanceSequentialTrun = new R2CoreTransportationAndLoadNotificationInstanceSequentialTurnsManager();
                var InstanceAES            = new AESAlgorithmsManager();
                var Content                 = JsonConvert.DeserializeObject <string>(Request.Content.ReadAsStringAsync().Result);
                var MobileNumber            = InstanceAES.Decrypt(Content.Split(';')[0], InstanceConfiguration.GetConfigString(R2CoreConfigurations.PublicSecurityConfiguration, 3));
                var TopSequentialTurnNumber = Content.Split(';')[2];
                var YearShamsi              = Content.Split(';')[3];

                var InstanceCarTruckNobat = new PayanehClassLibraryMClassCarTruckNobatManager();
                InstanceCarTruckNobat.TurnsCancellation(TopSequentialTurnNumber, InstanceSequentialTrun.GetNSSSequentialTurn(2), YearShamsi, NSSSoftwareuser);

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
                return(response);
            }
            catch (UserNotExistByApiKeyException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserLast5DigitNotMatchingException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserIdNotExistException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }
Esempio n. 2
0
        public HttpResponseMessage RealTimeTurnRegisterRequest()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClientApikeyNoncePersonalNonceWith2Parameter(Request, ATISMobileWebApiLogTypes.WebApiClientRealTimeTurnRegisterRequest);

                var NSSSoftwareuser       = WebAPi.GetNSSSoftwareUser(Request);
                var InstanceConfiguration = new R2CoreInstanceConfigurationManager();
                var InstanceSoftwareusers = new R2CoreInstanseSoftwareUsersManager();
                var InstanceAES           = new AESAlgorithmsManager();
                var Content      = JsonConvert.DeserializeObject <string>(Request.Content.ReadAsStringAsync().Result);
                var MobileNumber = InstanceAES.Decrypt(Content.Split(';')[0], InstanceConfiguration.GetConfigString(R2CoreConfigurations.PublicSecurityConfiguration, 3));
                var LPPelak      = Content.Split(';')[2];
                var LPSerial     = Content.Split(';')[3];

                var InstanceTurnRegisterRequest = new PayanehClassLibraryMClassTurnRegisterRequestManager();
                InstanceTurnRegisterRequest.RealTimeTurnRegisterRequestWithLicensePlate(LPPelak, LPSerial, NSSSoftwareuser, R2CoreTransportationAndLoadNotificationRequesters.ATISRestfullTurnControllerRealTimeTurnRegisterRequest, TurnType.Permanent);

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
                return(response);
            }
            catch (UserNotExistByApiKeyException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserLast5DigitNotMatchingException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserIdNotExistException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }
Esempio n. 3
0
        public HttpResponseMessage TruckDriverInqueryWithLicensePlate()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClientApikeyNoncePersonalNonceWith2Parameter(Request, ATISMobileWebApiLogTypes.WebApiClientTruckDriverInqueryWithLicensePlate);

                var NSSSoftwareuser       = WebAPi.GetNSSSoftwareUser(Request);
                var InstanceConfiguration = new R2CoreInstanceConfigurationManager();
                var InstanceSoftwareusers = new R2CoreInstanseSoftwareUsersManager();
                var InstanceAES           = new AESAlgorithmsManager();
                var Content      = JsonConvert.DeserializeObject <string>(Request.Content.ReadAsStringAsync().Result);
                var MobileNumber = InstanceAES.Decrypt(Content.Split(';')[0], InstanceConfiguration.GetConfigString(R2CoreConfigurations.PublicSecurityConfiguration, 3));
                var LPPelak      = Content.Split(';')[2];
                var LPSerial     = Content.Split(';')[3];

                var InstanceTruckDrivers     = new R2CoreTransportationAndLoadNotificationInstanceTruckDriversManager();
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(InstanceTruckDrivers.GetNSSTruckDriverWithLicensePlate(new R2CoreTransportationAndLoadNotificationStandardTruckStructure(new R2StandardCarStructure(null, null, LPPelak, LPSerial, null), null)).NSSDriver.StrPersonFullName), Encoding.UTF8, "application/json");
                return(response);
            }
            catch (UserNotExistByApiKeyException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserLast5DigitNotMatchingException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (UserIdNotExistException ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }