private void FillWcTruckInf() { try { if (TxtTruckSmartCardNo.Text == String.Empty) { return; } R2StandardCarTruckStructure NSSCarTruck = null; var InstacneLogin = new ATISWebMClassLoginManager(); var InstanceTrucks = new R2CoreTransportationAndLoadNotificationInstanceTrucksManager(); var InstanceCarTruck = new PayanehClassLibraryMClassCarTrucksManager(); try { NSSCarTruck = InstanceCarTruck.GetNSSCarTruckBySmartCardNo(TxtTruckSmartCardNo.Text); _WcNSSTruck = InstanceTrucks.GetNSSTruck(Convert.ToInt64(NSSCarTruck.NSSCar.nIdCar)); } catch (TruckInformationNotExistException ex) { PayanehWebService WS = new PayanehWebService(); var TruckId = WS.WebMethodGetnIdCarTruckBySmartCarNo(TxtTruckSmartCardNo.Text, WS.WebMethodLogin(InstacneLogin.GetNSSCurrentUser().UserShenaseh, InstacneLogin.GetNSSCurrentUser().UserPassword)); _WcNSSTruck = InstanceTrucks.GetNSSTruck(TruckId); WS = null; } } catch (Exception ex) when(ex is SqlInjectionException || ex is RMTOWebServiceSmartCardInvalidException || ex is InternetIsnotAvailableException || ex is RMTOWebServiceSmartCardInvalidException) { throw ex; } catch (PleaseReloginException ex) { Response.Redirect("/LoginManagement/Wflogin.aspx"); } catch (Exception ex) { throw new Exception(MethodBase.GetCurrentMethod().ReflectedType.FullName + "." + MethodBase.GetCurrentMethod().Name + "." + ex.Message); } }
public HttpResponseMessage SendTruckChangeRequestMessage() { ATISMobileWebApi WebAPi = new ATISMobileWebApi(); try { //تایید اعتبار کلاینت WebAPi.AuthenticateClientApikeyNoncePersonalNonceWith3Parameter(Request, ATISMobileWebApiLogTypes.WebApiClientSendTruckChangeMessageRequest); 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 NewTruckLicensePlate = Content.Split(';')[4]; var InstanceCarTrucks = new PayanehClassLibraryMClassCarTrucksManager(); var InstanceTrucks = new R2CoreTransportationAndLoadNotificationInstanceTrucksManager(); InstanceCarTrucks.SendTruckChangeRequestMessage(InstanceTrucks.GetNSSTruckWithLicensePlate(new R2CoreTransportationAndLoadNotificationStandardTruckStructure(new R2StandardCarStructure(null, null, LPPelak, LPSerial, null), null)), NewTruckLicensePlate, 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)); } }