public SSOApplicationGroup(SSOApplication application, SqlDataReader reader) { this.application = application; id = SharedDBCode.GetReaderIntField(reader, "id", SharedDBCode.DBReaderAction.DBReaderThrowException); description = SharedDBCode.GetReaderStringField(reader, "description", SharedDBCode.DBReaderAction.DBReaderThrowException); image = SharedDBCode.GetReaderStringField(reader, "interfase_image", SharedDBCode.DBReaderAction.DBReaderSetDefaultValue); priority = SharedDBCode.GetReaderIntField(reader, "interfase_priority", SharedDBCode.DBReaderAction.DBReaderSetDefaultValue, 0); try { parentId = SharedDBCode.GetReaderIntField(reader, "parent", SharedDBCode.DBReaderAction.DBReaderThrowException); } catch (Exception) { parentId = null; } // Unused properties name = description; isVisible = true; }
public SSOModule(Data.SSO_Applications application, int id, int module, string url, string name, string description, bool isProtected, string image, int?priority, bool isVisible, int?groupId) { // Inicializa aplicación this.application = new SSOApplication(application.id, application.name, application.description, application.url, application.intefase_visible); this.applicationId = application.id; // Inicializa módulo this.id = id; this.module = module; this.name = name; this.description = description; this.isProtected = isProtected; this.image = image; this.priority = priority.HasValue ? priority.Value : 0; this.isVisible = isVisible; this.groupId = groupId; // Prepara URLs para futuras búsquedas this.url = url.Replace("//", "/").Trim(); if (this.url != "/" && this.url.EndsWith("/")) { this.url = this.url.Substring(0, this.url.Length - 1); } if (this.url.Contains('?')) { string[] s = this.url.Split('?'); this.urlPath = s[0].Trim(); this.urlQuery = s[1].Trim(); } else { this.urlPath = this.url; this.urlQuery = String.Empty; } }