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

            try
            {
                //تایید اعتبار کلاینت
                WebAPi.AuthenticateClientApikeyNonceWith1Parameter(Request, ATISMobileWebApiLogTypes.WebApiClientRequestAnnouncedLoadsReportClearanceLoadsReport);
                var NSSSoftwareuser                       = WebAPi.GetNSSSoftwareUser(Request);
                var Content                               = JsonConvert.DeserializeObject <string>(Request.Content.ReadAsStringAsync().Result);
                var AHSGId                                = Convert.ToInt64(Content.Split(';')[2]);
                var InstanceLoadCapacitorLoad             = new R2CoreTransportationAndLoadNotificationInstanceLoadCapacitorLoadManager();
                List <KeyValuePair <string, string> > Lst = InstanceLoadCapacitorLoad.ReportingInformationProviderClearanceLoadsReport(AHSGId, NSSSoftwareuser);
                List <Models.AnnouncedLoadsReportClearanceLoadsReport> _AnnouncedLoadsReportClearanceLoadsReport = new List <Models.AnnouncedLoadsReportClearanceLoadsReport>();
                for (int Loopx = 0; Loopx <= Lst.Count - 1; Loopx++)
                {
                    var Item = new Models.AnnouncedLoadsReportClearanceLoadsReport();
                    Item.ReportItemHeader  = Lst[Loopx].Key;
                    Item.ReportItemDetails = Lst[Loopx].Value;
                    _AnnouncedLoadsReportClearanceLoadsReport.Add(Item);
                }
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(_AnnouncedLoadsReportClearanceLoadsReport), Encoding.UTF8, "application/json");
                return(response);
            }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }
Esempio n. 2
0
        public HttpResponseMessage ExistPermission()
        {
            ATISMobileWebApi WebAPi = new ATISMobileWebApi();

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

                var  Content = JsonConvert.DeserializeObject <string>(Request.Content.ReadAsStringAsync().Result);
                var  TargetMobileProcessId = Content.Split(';')[2];
                var  InstansePermissions   = new R2CoreInstansePermissionsManager();
                bool P = InstansePermissions.ExistPermission(R2CorePermissionTypes.SoftwareUsersAccessMobileProcesses, WebAPi.GetNSSSoftwareUser(Request).UserId, Convert.ToInt64(TargetMobileProcessId));

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(P), Encoding.UTF8, "application/json");
                return(response);
            }
            catch (Exception ex)
            { return(WebAPi.CreateErrorContentMessage(ex)); }
        }