コード例 #1
0
        public override string ToString()
        {
            string output = $"{SiteId.ToString().PadRight(13)} {MaxOccupancy.ToString().PadRight(17)}";

            if (IsAccessible)
            {
                output += "Yes".PadRight(15);
            }
            else
            {
                output += "No".PadRight(15);
            }

            if (MaxRvLength == 0)
            {
                output += "N/A".PadRight(15);
            }
            else
            {
                output += MaxRvLength.ToString().PadRight(15);
            }

            if (HasUtilities)
            {
                output += "Yes".PadRight(17);
            }
            else
            {
                output += "N/A".PadRight(17);
            }

            output += $"{TotalCost.ToString("C").PadRight(15)}";

            return(output);
        }
コード例 #2
0
        private void ConfigureModules()
        {
            Environment.Host.RouteBuilder.MapWebApiRoute(Defines.ModulesResource.Guid, $"{Defines.MODULES_PATH}/{{id?}}", new { controller = "modulegroups" });

            Environment.Hal.ProvideLink(Defines.ModulesResource.Guid, "self", module => new { href = ModuleHelper.GetModuleFeatureLocation(module.id) });

            // Web Server
            Environment.Hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.ModulesResource.Name, _ => {
                var id = GetModulesId(null, null);
                return(new { href = ModuleHelper.GetModuleFeatureLocation(id.Uuid) });
            });

            // Site
            Environment.Hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.ModulesResource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = GetModulesId(s, "/");
                return(new { href = ModuleHelper.GetModuleFeatureLocation(id.Uuid) });
            });

            // Application
            Environment.Hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.ModulesResource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = GetModulesId(s, appId.Path);
                return(new { href = ModuleHelper.GetModuleFeatureLocation(id.Uuid) });
            });
        }
コード例 #3
0
        internal void SaveGeneralInfo(XmlDocument serverConfigDocument)
        {
            XmlNode companies = serverConfigDocument.SelectSingleNode("/configuration/companies");
            XmlNode company   = companies.SelectSingleNode(string.Concat("company[@id='", Id, "']"));

            if (company == null)
            {
                company = companies.AppendChild(serverConfigDocument.CreateElement("company"));
            }

            XmlHelper.SetAttributeValue(company, "id", Id);
            XmlHelper.SetAttributeValue(company, "isActive", IsActive.ToString());
            XmlHelper.SetAttributeValue(company, "scheme", Scheme);
            XmlHelper.SetAttributeValue(company, "host", Host);
            XmlHelper.SetAttributeValue(company, "port", Port);
            XmlHelper.SetAttributeValue(company, "database", Database);
            XmlHelper.SetAttributeValue(company, "defaultLocale", _defaultLanguage.Locale);
            XmlHelper.SetAttributeValue(company, "codePath", CodePath);
            XmlHelper.SetAttributeValue(company, "codeVersion", CodeVersion.ToString(CultureInfo.InvariantCulture));
            XmlHelper.SetAttributeValue(company, "siteId", SiteId.ToString(CultureInfo.InvariantCulture));
            XmlHelper.SetAttributeValue(company, "imPool", IMPool);
            XmlHelper.SetAttributeValue(company, "portalPool", PortalPool);
            XmlHelper.SetAttributeValue(company, "portalPoolCreated", IsPortalPoolCreated.ToString());
            XmlHelper.SetAttributeValue(company, "created", Created.ToString(CultureInfo.InvariantCulture));
            XmlHelper.SetAttributeValue(company, "scheduleServiceEnabled", IsScheduleServiceEnabled.ToString());
        }
コード例 #4
0
ファイル: HE_HFNewPet.cs プロジェクト: tier6tank/DFWV
        internal override void Export(string table)
        {
            base.Export(table);

            table = GetType().Name;

            var vals = new List <object>
            {
                Id,
                HfIds.DBExport(),
                SiteId.DBExport(),
                SubregionId.DBExport(),
                FeatureLayerId.DBExport(),
                Coords.DBExport()
            };

            if (Pets != null)
            {
                var petExport = Pets.Aggregate("", (current, petRace) => current + (petRace.ToString() + ","));
                petExport = petExport.TrimEnd(',');
                vals.Add(petExport);
            }
            else
            {
                vals.Add(DBNull.Value);
            }

            Database.ExportWorldItem(table, vals);
        }
コード例 #5
0
        private void ConfigureIPRestrictions()
        {
            // Register controller routes in mvc framework
            Environment.Host.RouteBuilder.MapWebApiRoute(Defines.Resource.Guid, $"{Defines.PATH}/{{id?}}", new { controller = "iprestriction" });

            // Self
            Environment.Hal.ProvideLink(Defines.Resource.Guid, "self", ipRes => new { href = IPRestrictionsHelper.GetLocation(ipRes.id) });

            // Web Server
            Environment.Hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.Resource.Name, _ => {
                var id = GetIPRestrictionId(null, null);
                return(new { href = IPRestrictionsHelper.GetLocation(id.Uuid) });
            });

            // Site
            Environment.Hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.Resource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = GetIPRestrictionId(s, "/");
                return(new { href = IPRestrictionsHelper.GetLocation(id.Uuid) });
            });

            // Application
            Environment.Hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.Resource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = GetIPRestrictionId(s, appId.Path);
                return(new { href = IPRestrictionsHelper.GetLocation(id.Uuid) });
            });
        }
コード例 #6
0
        /*__________________________________________________________________________________________*/
        public override bool IsButtonAvailable(string buttonTagName, SiteId currentSiteId)
        {
            if (currentSiteId == null || string.IsNullOrEmpty(buttonTagName))
            {
                return(false);
            }

            if (currentSiteId.AvailableButtons != null && currentSiteId.AvailableButtons.Count > 0)
            {
                try
                {
                    var btnName = (from buttonTag in currentSiteId.AvailableButtons
                                   where buttonTag.ToLower() == buttonTagName.ToLower()
                                   select buttonTag).First();
                    if (btnName != null)
                    {
                        return(true);
                    }
                }
                catch (Exception)
                {
                    return(false);
                }
            }


            return(true);
        }
コード例 #7
0
ファイル: HE_BodyAbused.cs プロジェクト: tier6tank/DFWV
        internal override void Export(string table)
        {
            //TODO: Incorporate new data
            base.Export(table);

            table = GetType().Name;


            var vals = new List <object>
            {
                Id,
                SiteId.DBExport(),
                SubregionId.DBExport(),
                FeatureLayerId.DBExport(),
                Coords.DBExport(),
                EntityId_Abuser.DBExport(),
                BodyHfiDs.DBExport(),
                ItemType.DBExport(Item.ItemTypes),
                ItemSubType.DBExport(Item.ItemSubTypes),
                ItemMat.DBExport(Item.Materials),
                HfId.DBExport(),
                AbuseType.DBExport()
            };



            Database.ExportWorldItem(table, vals);
        }
コード例 #8
0
        public Task BindModelAsync(ModelBindingContext bindingContext)
        {
            if (bindingContext == null)
            {
                throw new ArgumentNullException(nameof(bindingContext));
            }

            var modelName           = bindingContext.ModelName;
            var valueProviderResult = bindingContext.ValueProvider.GetValue(modelName);

            if (valueProviderResult == ValueProviderResult.None)
            {
                return(Task.CompletedTask);
            }

            bindingContext.ModelState.SetModelValue(modelName, valueProviderResult);

            var identity = valueProviderResult.FirstValue;

            if (!SiteId.IsValid(identity))
            {
                bindingContext.ModelState.TryAddModelError(bindingContext.ModelName, "Not a valid SiteId");
                return(Task.CompletedTask);
            }

            var siteId = new SiteId(identity);

            bindingContext.Result = ModelBindingResult.Success(siteId);
            return(Task.CompletedTask);
        }
コード例 #9
0
        public override void Start()
        {
            var host = Environment.Host;

            // Register all controller routes in mvc framework
            host.RouteBuilder.MapWebApiRoute(Defines.Resource.Guid, $"{Defines.PATH}/{{id?}}", new { controller = "HttpRedirect" });

            // Self
            Environment.Hal.ProvideLink(Defines.Resource.Guid, "self", doc => new { href = RedirectHelper.GetLocation(doc.id) });

            // Web Server
            Environment.Hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.Resource.Name, _ => {
                var id = GetDefaultDocumentId(null, null);
                return(new { href = RedirectHelper.GetLocation(id.Uuid) });
            });

            // Site
            Environment.Hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.Resource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = GetDefaultDocumentId(s, "/");
                return(new { href = RedirectHelper.GetLocation(id.Uuid) });
            });

            // Application
            Environment.Hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.Resource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = GetDefaultDocumentId(s, appId.Path);
                return(new { href = RedirectHelper.GetLocation(id.Uuid) });
            });
        }
コード例 #10
0
        internal override void Export(string table)
        {
            base.Export(table);

            table = GetType().Name;

            var vals = new List <object>
            {
                Id,
                HfId.DBExport(),
                HfId_Slayer.DBExport(),
                SlayerRace.DBExport(),
                SlayerCaste.DBExport(HistoricalFigure.Castes),
                ArtifiactId_SlayerItem.DBExport(),
                ArtifactId_SlayerShooterItem.DBExport(),
                Cause.DBExport(Causes),
                SiteId.DBExport(),
                SubregionId.DBExport(),
                FeatureLayerId.DBExport(),
                ItemID.DBExport(),
                ArtifactId.DBExport(),
                ItemType.DBExport(Item.ItemTypes),
                ItemSubType.DBExport(Item.ItemSubTypes),
                Mat.DBExport(Item.Materials),
                BowItem.DBExport(),
                BowArtifactId.DBExport(),
                BowItemType.DBExport(Item.ItemTypes),
                BowItemSubType.DBExport(Item.ItemSubTypes),
                BowMat.DBExport(Item.Materials)
            };

            Database.ExportWorldItem(table, vals);
        }
コード例 #11
0
        public override void Start()
        {
            var host = Environment.Host;
            var hal  = Environment.Hal;

            host.RouteBuilder.MapWebApiRoute(Defines.Resource.Guid, $"{Defines.PATH}/{{id?}}", new { controller = "compression" });

            // Self
            hal.ProvideLink(Defines.Resource.Guid, "self", comp => new { href = CompressionHelper.GetLocation(comp.id) });

            // Web Server
            hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.Resource.Name, _ => {
                var id = new CompressionId(null, null, CompressionHelper.IsSectionLocal(null, null));
                return(new { href = CompressionHelper.GetLocation(id.Uuid) });
            });

            // Site
            hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.Resource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = new CompressionId(siteId.Id, "/", CompressionHelper.IsSectionLocal(s, "/"));
                return(new { href = CompressionHelper.GetLocation(id.Uuid) });
            });

            // Application
            hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.Resource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = new CompressionId(appId.SiteId, appId.Path, CompressionHelper.IsSectionLocal(s, appId.Path));
                return(new { href = CompressionHelper.GetLocation(id.Uuid) });
            });
        }
コード例 #12
0
        //updates values of accessible, rv length, and utilities to be more user-friendly
        public override string ToString()
        {
            if (Accessible == "False")
            {
                Accessible = "No";
            }
            else if (Accessible == "True")
            {
                Accessible = "Yes";
            }

            if (Utilities == "False")
            {
                Utilities = "No";
            }
            else if (Utilities == "True")
            {
                Utilities = "Yes";
            }

            if (MaxRVLength == "0")
            {
                MaxRVLength = "N/A";
            }

            return(SiteId.ToString().PadRight(11) + MaxOccupancy.ToString().PadRight(13) + Accessible.PadRight(15) + MaxRVLength.PadRight(15) + Utilities.PadRight(11) + "$");
        }
コード例 #13
0
        private void ConfigureStaticContent()
        {
            // Provide mvc with route
            Environment.Host.RouteBuilder.MapWebApiRoute(Defines.Resource.Guid, $"{Defines.PATH}/{{id?}}", new { controller = "staticcontent" });

            // Register self hypermedia
            Environment.Hal.ProvideLink(Defines.Resource.Guid, "self", sc => new { href = StaticContentHelper.GetLocation(sc.id) });

            // Web Server
            Environment.Hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.Resource.Name, _ => {
                var id = GetStaticContentId(null, null);
                return(new { href = StaticContentHelper.GetLocation(id.Uuid) });
            });

            // Site
            Environment.Hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.Resource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = GetStaticContentId(s, "/");
                return(new { href = StaticContentHelper.GetLocation(id.Uuid) });
            });

            // Application
            Environment.Hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.Resource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = GetStaticContentId(s, appId.Path);
                return(new { href = StaticContentHelper.GetLocation(id.Uuid) });
            });
        }
コード例 #14
0
ファイル: CdwVitalsDao.cs プロジェクト: govtmirror/RAPTOR-1
        internal VitalSign buildVitalSign(IDataReader reader)
        {
            SiteId facility = new SiteId()
            {
                Id   = DbReaderUtil.getInt16Value(reader, reader.GetOrdinal("Sta3n")),
                Name = DbReaderUtil.getValue(reader, reader.GetOrdinal("Location"))
            };

            string          id        = DbReaderUtil.getInt64Value(reader, reader.GetOrdinal("VitalSignSID"));
            string          dateTaken = DbReaderUtil.getDateTimeValue(reader, reader.GetOrdinal("VitalSignTakenDateTime"));
            string          vitalType = DbReaderUtil.getValue(reader, reader.GetOrdinal("VitalType"));
            string          typeId    = DbReaderUtil.getInt32Value(reader, reader.GetOrdinal("VitalTypeSID"));
            ObservationType type      = new ObservationType(typeId, VitalSign.VITAL_SIGN, vitalType);

            VitalSign vitalSign = new VitalSign()
            {
                Id        = id,
                Facility  = facility,
                Type      = type,
                Value1    = DbReaderUtil.getValue(reader, reader.GetOrdinal("Result")),
                Timestamp = dateTaken
            };

            return(vitalSign);
        }
コード例 #15
0
        private void ConfigureHttpRequestTracing()
        {
            Environment.Host.RouteBuilder.MapWebApiRoute(Defines.Resource.Guid, $"{Defines.PATH}/{{id?}}", new { controller = "HttpRequestTracing" });

            // Self
            Environment.Hal.ProvideLink(Defines.Resource.Guid, "self", hrt => new { href = Helper.GetLocation(hrt.id) });

            // Web Server
            Environment.Hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.Resource.Name, _ => {
                var id = new HttpRequestTracingId(null, null, Helper.IsSectionLocal(null, null));
                return(new { href = Helper.GetLocation(id.Uuid) });
            });

            // Site
            Environment.Hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.Resource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = new HttpRequestTracingId(siteId.Id, "/", Helper.IsSectionLocal(s, "/"));
                return(new { href = Helper.GetLocation(id.Uuid) });
            });

            // Application
            Environment.Hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.Resource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = new HttpRequestTracingId(appId.SiteId, appId.Path, Helper.IsSectionLocal(s, appId.Path));
                return(new { href = Helper.GetLocation(id.Uuid) });
            });
        }
コード例 #16
0
        public string Update_POST()
        {
            var category = ServiceCall.Instance.SiteService.GetCategory(
                SiteId, int.Parse(Request.Form("ID").ToString()));

            if (!(category.ID > 0))
            {
                return(ReturnError("分类不存在!"));
            }

            //获取新的栏目信息
            category = InitCategoryDtoFromHttpPost(Request, category);

            var parentId = Convert.ToInt32(Request.Form("ParentId"));
            //设置并保存
            var r = ServiceCall.Instance.SiteService.SaveCategory(SiteId, parentId, category);

            if (r.ErrCode > 0)
            {
                return(ReturnError(r.ErrMsg));
            }
            var key = Consts.NODE_TREE_JSON_KEY + ":" + SiteId.ToString();

            Kvdb.Gca.Delete(key);
            return(ReturnSuccess("保存成功!"));
        }
コード例 #17
0
        private void ConfigureAuthentication()
        {
            var router = Environment.Host.RouteBuilder;
            var hal    = Environment.Hal;

            //
            // Route
            router.MapWebApiRoute(Defines.AuthenticationResource.Guid, $"{Defines.AUTHENTICATION_PATH}/{{id}}", new { controller = "authentication" });

            //
            // Hal
            hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.AuthenticationResource.Name, _ => {
                var id = new AuthenticationId(null, null);
                return(new { href = $"/{Defines.AUTHENTICATION_PATH}/{id.Uuid}" });
            });

            hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.AuthenticationResource.Name, site => {
                var siteId = new SiteId((string)site.id);
                var id     = new AuthenticationId(siteId.Id, "/");
                return(new { href = $"/{Defines.AUTHENTICATION_PATH}/{id.Uuid}" });
            });

            hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.AuthenticationResource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                var id    = new AuthenticationId(appId.SiteId, appId.Path);
                return(new { href = $"/{Defines.AUTHENTICATION_PATH}/{id.Uuid}" });
            });
        }
コード例 #18
0
ファイル: Startup.cs プロジェクト: zyonet/IIS.Administration
        private void ConfigureUrlRewrite()
        {
            // MVC routing
            Environment.Host.RouteBuilder.MapWebApiRoute(Defines.Resource.Guid, $"{Defines.PATH}/{{id?}}", new { controller = "UrlRewrite" });

            // Self
            Environment.Hal.ProvideLink(Defines.Resource.Guid, "self", rf => new { href = RewriteHelper.GetLocation(rf.id) });


            // Web Server
            Environment.Hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.Resource.Name, _ => {
                var id = GetRewriteId(null, null);
                return(new { href = RewriteHelper.GetLocation(id.Uuid) });
            });

            // Site
            Environment.Hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.Resource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = GetRewriteId(s, "/");
                return(new { href = RewriteHelper.GetLocation(id.Uuid) });
            });

            // Application
            Environment.Hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.Resource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = GetRewriteId(s, appId.Path);
                return(new { href = RewriteHelper.GetLocation(id.Uuid) });
            });
        }
コード例 #19
0
 /// <summary>
 /// Get parameters method - call between beginSite and endSite
 /// </summary>
 /// <param name="caller">Calling class object</param>
 /// <param name="siteId">SiteId specifier object</param>
 /// <param name="rules" >List of BusinessRuleVO objects - </param>
 /// <returns></returns>
 public PawnRulesSystemReturnCode getParameters(
     object caller,
     SiteId siteId,
     ref Dictionary <string, BusinessRuleVO> rules)
 {
     return(new PawnRulesSystemReturnCode(PawnRulesSystemReturnCode.Code.SUCCESS));
 }
コード例 #20
0
        public override void Start()
        {
            Environment.Host.RouteBuilder.MapWebApiRoute(Defines.Resource.Guid, $"{Defines.PATH}/{{id?}}", new { controller = "directorybrowsing" });

            // Self
            Environment.Hal.ProvideLink(Defines.Resource.Guid, "self", dirb => new { href = DirectoryBrowsingHelper.GetLocation(dirb.id) });

            // Webserver
            Environment.Hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.Resource.Name, _ => {
                var id = GetDirectoryBrowsingId(null, null);
                return(new { href = DirectoryBrowsingHelper.GetLocation(id.Uuid) });
            });

            // Site
            Environment.Hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.Resource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = GetDirectoryBrowsingId(s, "/");
                return(new { href = DirectoryBrowsingHelper.GetLocation(id.Uuid) });
            });

            // Application
            Environment.Hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.Resource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = GetDirectoryBrowsingId(s, appId.Path);
                return(new { href = DirectoryBrowsingHelper.GetLocation(id.Uuid) });
            });
        }
コード例 #21
0
 public PfiPickupCalculator(PawnLoan pawnLoan, SiteId currentSiteId, DateTime pickupDate)
 {
     ApplicableFees = new List <Fee>();
     PawnLoan       = pawnLoan;
     PickupDate     = pickupDate;
     CurrentSiteId  = currentSiteId;
 }
コード例 #22
0
        private void customButtonFind_Click(object sender, EventArgs e)
        {
            if (customTextBoxDestShopNo.isValid)
            {
                //If the shop number entered is valid, call data layer
                //to get the store information
                SiteId storeInfo = new SiteId();

                ShopProcedures.ExecuteGetStoreInfo(GlobalDataAccessor.Instance.OracleDA,
                                                   customTextBoxDestShopNo.Text.ToString(), ref storeInfo, out errorCode, out errorText);
                if (storeInfo != null)
                {
                    destinationStoreDataFound = true;
                    destShopName               = storeInfo.StoreName;
                    labelDestAddr1.Text        = storeInfo.StoreAddress1;
                    labelDestAddr2.Text        = storeInfo.StoreCityName + "," + storeInfo.State + " " + storeInfo.StoreZipCode;
                    labelDestManager.Text      = storeInfo.StoreManager;
                    labelDestPhone.Text        = storeInfo.StorePhoneNo;
                    customButtonSubmit.Enabled = !string.IsNullOrEmpty(storeInfo.StoreName);
                }
            }
            else
            {
                MessageBox.Show(@"Please enter a valid destination shop number");
            }
        }
コード例 #23
0
        private void ConfigureAuthorization()
        {
            var host = Environment.Host;
            var hal  = Environment.Hal;

            host.RouteBuilder.MapWebApiRoute(Defines.AuthorizationResource.Guid, $"{Defines.AUTHORIZATION_PATH}/{{id?}}", new { controller = "authorization" });

            // Self
            hal.ProvideLink(Defines.AuthorizationResource.Guid, "self", authorization => new { href = $"/{Defines.AUTHORIZATION_PATH}/{authorization.id}" });

            // Web Server
            hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.AuthorizationResource.Name, _ => {
                var id = new AuthorizationId(null, null, AuthorizationHelper.IsSectionLocal(null, null));
                return(new { href = $"/{Defines.AUTHORIZATION_PATH}/{id.Uuid}" });
            });

            // Site
            hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.AuthorizationResource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = new AuthorizationId(siteId.Id, "/", AuthorizationHelper.IsSectionLocal(s, "/"));
                return(new { href = $"/{Defines.AUTHORIZATION_PATH}/{id.Uuid}" });
            });

            // Application
            hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.AuthorizationResource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = new AuthorizationId(appId.SiteId, appId.Path, AuthorizationHelper.IsSectionLocal(s, appId.Path));
                return(new { href = $"/{Defines.AUTHORIZATION_PATH}/{id.Uuid}" });
            });
        }
コード例 #24
0
        private void btnContinue_Click(object sender, EventArgs e)
        {
            SiteId store = ddlStore.SelectedItem as SiteId;

            if (store == null)
            {
                return;
            }

            List <InventoryAuditVO> audits      = new List <InventoryAuditVO>();
            CommonDatabaseContext   dataContext = CreateCommonDatabaseContext();

            if (!InventoryAuditProcedures.GetInventoryAudits(audits, null, "ACTIVE", dataContext))
            {
                MessageBox.Show("Error loading active audits.");
                return;
            }

            if (audits.Any(a => a.StoreNumber == store.StoreNumber))
            {
                MessageBox.Show("There is already an active audit for this store.  Complete the existing audit and try again.");
                return;
            }

            ADS.ActiveAudit             = new InventoryAuditVO();
            ADS.ActiveAudit.StoreNumber = store.StoreNumber;
            ADS.ActiveAudit.InitiatedBy = ADS.ActiveUserData.CurrentUserFullName;
            NavControlBox.Action        = NavBox.NavAction.SUBMIT;
        }
コード例 #25
0
 public Dictionary <string, int> SearchIndexHash(SiteSettings ss)
 {
     if (AccessStatus != Databases.AccessStatuses.Selected)
     {
         return(null);
     }
     else
     {
         var searchIndexHash = new Dictionary <string, int>();
         SiteInfo.TenantCaches[Sessions.TenantId()]
         .SiteMenu.Breadcrumb(SiteId).SearchIndexes(searchIndexHash, 100);
         SiteId.SearchIndexes(searchIndexHash, 200);
         UpdatedTime.SearchIndexes(searchIndexHash, 200);
         WikiId.SearchIndexes(searchIndexHash, 1);
         Title.SearchIndexes(searchIndexHash, 4);
         Body.SearchIndexes(searchIndexHash, 200);
         Comments.SearchIndexes(searchIndexHash, 200);
         Creator.SearchIndexes(searchIndexHash, 100);
         Updator.SearchIndexes(searchIndexHash, 100);
         CreatedTime.SearchIndexes(searchIndexHash, 200);
         SearchIndexExtensions.OutgoingMailsSearchIndexes(
             searchIndexHash, "Wikis", WikiId);
         return(searchIndexHash);
     }
 }
コード例 #26
0
        public string PropertyValue(string name)
        {
            switch (name)
            {
            case "SiteId": return(SiteId.ToString());

            case "UpdatedTime": return(UpdatedTime.Value.ToString());

            case "WikiId": return(WikiId.ToString());

            case "Ver": return(Ver.ToString());

            case "Title": return(Title.Value);

            case "Body": return(Body);

            case "TitleBody": return(TitleBody.ToString());

            case "Comments": return(Comments.ToJson());

            case "Creator": return(Creator.Id.ToString());

            case "Updator": return(Updator.Id.ToString());

            case "CreatedTime": return(CreatedTime.Value.ToString());

            case "VerUp": return(VerUp.ToString());

            case "Timestamp": return(Timestamp);

            default: return(null);
            }
        }
コード例 #27
0
 public Dictionary <string, int> SearchIndexHash(Context context, SiteSettings ss)
 {
     if (AccessStatus != Databases.AccessStatuses.Selected)
     {
         return(null);
     }
     else
     {
         var searchIndexHash = new Dictionary <string, int>();
         SiteInfo.TenantCaches.Get(context.TenantId)?
         .SiteMenu
         .Breadcrumb(context: context, siteId: SiteId)
         .SearchIndexes(context, searchIndexHash, 100);
         SiteId.SearchIndexes(context, searchIndexHash, 200);
         UpdatedTime.SearchIndexes(context, searchIndexHash, 200);
         WikiId.SearchIndexes(context, searchIndexHash, 1);
         Title.SearchIndexes(context, searchIndexHash, 4);
         Body.SearchIndexes(context, searchIndexHash, 200);
         Comments.SearchIndexes(context, searchIndexHash, 200);
         Creator.SearchIndexes(context, searchIndexHash, 100);
         Updator.SearchIndexes(context, searchIndexHash, 100);
         CreatedTime.SearchIndexes(context, searchIndexHash, 200);
         SearchIndexExtensions.OutgoingMailsSearchIndexes(
             context: context,
             searchIndexHash: searchIndexHash,
             referenceType: "Wikis",
             referenceId: WikiId);
         return(searchIndexHash);
     }
 }
コード例 #28
0
        internal override void Export(string table)
        {
            base.Export(table);

            table = GetType().Name;

            var vals = new List <object>
            {
                Id,
                HfId.DBExport(),
                EntityId.DBExport(),
                SiteId.DBExport(),
                SkillAtTime,
                ItemType.DBExport(Item.ItemTypes),
                ItemSubType.DBExport(Item.ItemSubTypes),
                Mat.DBExport(Item.Materials),
                ImprovementType.DBExport(ImprovementTypes),
                //ImprovementSubType.DBExport(), //TODO: Uncomment this
                ImprovementMat.DBExport(Item.Materials),
                ArtId.DBExport(),
                ArtSubId.DBExport()
            };

            Database.ExportWorldItem(table, vals);
        }
コード例 #29
0
        private void ConfigureHttpResponseHeaders()
        {
            Environment.Host.RouteBuilder.MapWebApiRoute(Defines.Resource.Guid, $"{ Defines.PATH}/{{id?}}", new { controller = "HttpResponseHeaders" });

            Environment.Hal.ProvideLink(Defines.Resource.Guid, "self", respHeader => new { href = HttpResponseHeadersHelper.GetLocation(respHeader.id) });

            // Web Server
            Environment.Hal.ProvideLink(WebServer.Defines.Resource.Guid, Defines.Resource.Name, _ => {
                var id = GetHttpResponseHeadersId(null, null);
                return(new { href = HttpResponseHeadersHelper.GetLocation(id.Uuid) });
            });

            // Sites
            Environment.Hal.ProvideLink(Sites.Defines.Resource.Guid, Defines.Resource.Name, site => {
                var siteId = new SiteId((string)site.id);
                Site s     = SiteHelper.GetSite(siteId.Id);
                var id     = GetHttpResponseHeadersId(s, "/");
                return(new { href = HttpResponseHeadersHelper.GetLocation(id.Uuid) });
            });

            // Applications
            Environment.Hal.ProvideLink(Applications.Defines.Resource.Guid, Defines.Resource.Name, app => {
                var appId = new ApplicationId((string)app.id);
                Site s    = SiteHelper.GetSite(appId.SiteId);
                var id    = GetHttpResponseHeadersId(s, appId.Path);
                return(new { href = HttpResponseHeadersHelper.GetLocation(id.Uuid) });
            });
        }
コード例 #30
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            SpContents.ControlToPaginate = RptContents;
            RptContents.ItemDataBound   += RptContents_ItemDataBound;
            SpContents.ItemsPerPage      = SiteInfo.Additional.PageSize;

            SpContents.SelectCommand = DataProvider.ContentDao.GetSelectCommandByHitsAnalysis(SiteInfo.TableName, SiteId);

            SpContents.SortField = ContentAttribute.Hits;
            SpContents.SortMode  = SortMode.DESC;

            _pageUrl = GetRedirectUrl(SiteId);

            if (IsPostBack)
            {
                return;
            }

            VerifySystemPermissions(ConfigManager.AppPermissions.SettingsAnalysisSite);

            DdlSiteId.Items.Add(new ListItem("<<全部站点>>", "0"));
            var siteIdList = SiteManager.GetSiteIdListOrderByLevel();

            foreach (var siteId in siteIdList)
            {
                var siteInfo = SiteManager.GetSiteInfo(siteId);
                DdlSiteId.Items.Add(new ListItem(siteInfo.SiteName, siteId.ToString()));
            }
            ControlUtils.SelectSingleItem(DdlSiteId, SiteId.ToString());

            SpContents.DataBind();

            foreach (var contentId in _contentIdList)
            {
                var yValueHits      = GetYHashtable(contentId, YTypeHits);
                var yValueHitsDay   = GetYHashtable(contentId, YTypeHitsDay);
                var yValueHitsWeek  = GetYHashtable(contentId, YTypeHitsWeek);
                var yValueHitsMonth = GetYHashtable(contentId, YTypeHitsMonth);
                var xValue          = GetXHashtable(contentId);
                if (xValue.Length > 10)
                {
                    xValue = xValue.Substring(0, 10);
                }

                StrArray += $@"
xArrayHits.push('{xValue}');
yArrayHits.push('{yValueHits}');
yArrayHitsDay.push('{yValueHitsDay}');
yArrayHitsWeek.push('{yValueHitsWeek}');
yArrayHitsMonth.push('{yValueHitsMonth}');
";
            }
        }
コード例 #31
0
ファイル: ViewAreaFactory.cs プロジェクト: hgarcia/Pronghorn
 public IList<IViewArea> GetViewAreas(Route route, SiteId siteId)
 {
     return _widgetRepository.GetAreasForUrl(route.Url, siteId.Id);
 }
コード例 #32
0
ファイル: PatientMatchesResponse.cs プロジェクト: OSEHRA/mdo
        public Patient getPatient(int rdtIdx)
        {
            if (RDT == null)
            {
                return null;
            }
            if (QAK.QueryResponseStatus != "OK")
            {
                return null;
            }
            if (rdtIdx > RDT.Length)
            {
                throw new IndexOutOfRangeException("Only " + RDT.Length + " RDTs");
            }
            Patient result = new Patient();

            RdtColumn column = RDT[rdtIdx].getColumn(MpiConstants.LASTNAME_FLDNAME);
            string patname = column.Values[0];
            column = RDT[rdtIdx].getColumn(MpiConstants.FIRSTNAME_FLDNAME);
            if (column.Values != null && !StringUtils.isEmpty(column.Values[0]))
            {
                patname += ',' + column.Values[0];
            }
            column = RDT[rdtIdx].getColumn(MpiConstants.MIDDLENAME_FLDNAME);
            if (column.Values != null && !StringUtils.isEmpty(column.Values[0]))
            {
                patname += ' ' + column.Values[0];
            }
            column = RDT[rdtIdx].getColumn(MpiConstants.NAMESUFFIX_FLDNAME);
            if (column.Values != null && !StringUtils.isEmpty(column.Values[0]))
            {
                patname += ' ' + column.Values[0];
            }
            result.Name = new PersonName(patname);

            column = RDT[rdtIdx].getColumn(MpiConstants.SSN_FLDNAME);
            result.SSN = new SocSecNum(column.Values[0]);

            column = RDT[rdtIdx].getColumn(MpiConstants.ICN_FLDNAME);
            string[] parts = StringUtils.split(column.Values[0], 'V');
            result.MpiPid = parts[0];
            result.MpiChecksum = parts[1];

            column = RDT[rdtIdx].getColumn(MpiConstants.DOB_FLDNAME);
            if (column.Values != null && !StringUtils.isEmpty(column.Values[0]))
            {
                result.DOB = column.Values[0];
            }

            column = RDT[rdtIdx].getColumn(MpiConstants.SEX_FLDNAME);
            if (column != null && column.Values != null)
            {
                result.Gender = column.Values[0];
            }

            column = RDT[rdtIdx].getColumn(MpiConstants.DECEASEDDATE_FLDNAME);
            if (column.Values != null && !StringUtils.isEmpty(column.Values[0]))
            {
                result.DeceasedDate = column.Values[0];
            }

            column = RDT[rdtIdx].getColumn(MpiConstants.SITES_FLDNAME);
            if (column != null && column.Values != null && column.Values.Length > 0)
            {
                ArrayList lst = new ArrayList(column.Values.Length);
                for (int i = 0; i < column.Values.Length; i++)
                {
                    parts = StringUtils.split(column.Values[i], StringUtils.CARET);
                    if (parts[0].Length == 3 && StringUtils.isNumeric(parts[0]) && parts[0] != "003")
                    {
                        SiteId s = new SiteId(parts[0],"","","");
                        if (parts.Length > 2)
                        {
                            s = new SiteId(parts[0], "", parts[1], parts[2]);
                        }
                        lst.Add(s);
                    }
                }
                result.SiteIDs = (SiteId[])lst.ToArray(typeof(SiteId));
            }

            column = RDT[rdtIdx].getColumn(MpiConstants.CMOR_FLDNAME);
            if (column != null && !StringUtils.isEmpty(column.Values[0]))
            {
                result.CmorSiteId = column.Values[0];
            }

            return result;
        }
コード例 #33
0
ファイル: VistaPatientDao.cs プロジェクト: OSEHRA/mdo
 public SiteId[] getSiteIDs(string dfn)
 {
     MdoQuery request = buildGetRemoteSitesRequest(dfn);
     string response = (string)cxn.query(request);
     if (response.StartsWith("-1^"))
     {
         return new SiteId[] { new SiteId(cxn.DataSource.SiteId.Id, cxn.DataSource.SiteId.Name) };
     }
     string[] lines = StringUtils.split(response, StringUtils.CRLF);
     lines = StringUtils.trimArray(lines);
     // SLC's test Vista reports the local site as one of the patient's remote sites. We should
     // make sure we don't add the same site to this collection twice
     Dictionary<string, SiteId> siteDict = new Dictionary<string, SiteId>();
     SiteId connectedSite = new SiteId(cxn.DataSource.SiteId.Id, cxn.DataSource.SiteId.Name);
     siteDict.Add(connectedSite.Id, connectedSite);
     for (int i = 0; i < lines.Length; i++)
     {
         string[] flds = StringUtils.split(lines[i], StringUtils.CARET);
         SiteId current = new SiteId(flds[0], flds[1], flds[2], flds[3]);
         if (siteDict.ContainsKey(current.Id))
         {
             continue;
         }
         siteDict.Add(current.Id, current);
     }
     SiteId[] result = new SiteId[siteDict.Count];
     siteDict.Values.CopyTo(result, 0);
     return result;
 }
コード例 #34
0
ファイル: VistaClinicalDao.cs プロジェクト: OSEHRA/mdo
        internal Medications toCCRMedsFromXmlNode(XmlNode node)
        {
            Medications meds = new Medications();

            int total = verifyTopLevelNode(node);
            if (total == 0)
            {
                return meds;
            }
            XmlNodeList medNodes = node.SelectNodes("/med");
            if (medNodes == null || medNodes.Count == 0)
            {
                return meds;
            }

            meds.Medication = new List<StructuredProductType>();// new List<StructuredProductType>();
            CCRHelper ccrHelper = new CCRHelper();

            foreach (XmlNode medNode in medNodes)
            {
                string cost = XmlUtils.getXmlAttributeValue(medNode, "fillCost", "value");
                string daysSupply = XmlUtils.getXmlAttributeValue(medNode, "daysSupply", "value");
                string medId = XmlUtils.getXmlAttributeValue(medNode, "id", "value");
                KeyValuePair<string, string> hospitalLocation =
                    new KeyValuePair<string, string>(XmlUtils.getXmlAttributeValue(medNode, "location", "code"), XmlUtils.getXmlAttributeValue(medNode, "location", "name"));
                string medName = XmlUtils.getXmlAttributeValue(medNode, "name", "value");

                string pharmId = XmlUtils.getXmlAttributeValue(medNode, "medID", "value");
                string orderId = XmlUtils.getXmlAttributeValue(medNode, "orderID", "value");
                string refills = XmlUtils.getXmlAttributeValue(medNode, "fillsAllowed", "value");
                string refillsRemaining = XmlUtils.getXmlAttributeValue(medNode, "fillsRemaining", "value");
                SiteId facility = new SiteId(XmlUtils.getXmlAttributeValue(medNode, "facility", "code"), XmlUtils.getXmlAttributeValue(medNode, "facility", "name"));
                Author provider = new Author(XmlUtils.getXmlAttributeValue(medNode, "orderingProvider", "code"), XmlUtils.getXmlAttributeValue(medNode, "orderingProvider", "name"), "");
                string rxNumber = XmlUtils.getXmlAttributeValue(medNode, "prescription", "value");
                string quantity = XmlUtils.getXmlAttributeValue(medNode, "quantity", "value");

                string sig = "";
                XmlNode sigNode = medNode.SelectSingleNode("sig");
                if (sigNode != null)
                {
                    sig = sigNode.InnerXml;
                }
                string status = XmlUtils.getXmlAttributeValue(medNode, "vaStatus", "value");
                string medType = XmlUtils.getXmlAttributeValue(medNode, "vaType", "value");
                string dose = XmlUtils.getXmlAttributeValue(medNode, "doses/dose", "dose");
                string route = XmlUtils.getXmlAttributeValue(medNode, "doses/dose", "route");
                string schedule = XmlUtils.getXmlAttributeValue(medNode, "doses/dose", "schedule");
                string rate = XmlUtils.getXmlAttributeValue(medNode, "rate", "value");

                // this should be a dictionary - can have more than 1 orderable item associate with a med (e.g. two components of a solution for IV med)
                // these should be the <products> nodes
                //med.PharmacyOrderableItem

                string expires = XmlUtils.getXmlAttributeValue(medNode, "expires", "value");
                string issued = XmlUtils.getXmlAttributeValue(medNode, "ordered", "value");
                string lastFilled = XmlUtils.getXmlAttributeValue(medNode, "lastFilled", "value");
                string startDate = XmlUtils.getXmlAttributeValue(medNode, "start", "value");
                string stopDate = XmlUtils.getXmlAttributeValue(medNode, "stop", "value");

                // extra data in CCR med only
                string unitsPerDose = XmlUtils.getXmlAttributeValue(medNode, "doses/dose", "unitsPerDose");
                string units = XmlUtils.getXmlAttributeValue(medNode, "doses/dose", "units");
                string form = XmlUtils.getXmlAttributeValue(medNode, "doses/dose", "noun");

                StructuredProductType ccrMed = ccrHelper.buildMedObject(medName, medId, startDate, stopDate, issued, lastFilled, expires,
                    sig, dose, units, form, unitsPerDose, schedule, route, refills, refillsRemaining, quantity,
                    provider.Name, provider.Id, status, medType);

                meds.Medication.Add(ccrMed);
            }
            return meds;
        }