public virtual Lazaro.Pres.Forms.FormActionCollection GetFormActions() { if (m_FormActions == null) { m_FormActions = new Lazaro.Pres.Forms.FormActionCollection(); // Obtengo una lista de acciones basadas en la tabla sys_tags if (this.ElementoTipo != null && Lfx.Data.DatabaseCache.DefaultCache.Tables.ContainsKey("sys_tags")) { Lbl.Atributos.Datos AttrDatos = this.ElementoTipo.GetAttribute <Lbl.Atributos.Datos>(); if (AttrDatos != null) { string NombreTabla = AttrDatos.TablaDatos; var Conn = this.Connection; if (Conn == null) { Conn = Lfx.Workspace.Master.MasterConnection; } System.Data.DataTable TagsTable = Conn.Select("SELECT * FROM sys_tags WHERE fieldtype IN ('action') AND tablename='" + NombreTabla + "'"); foreach (System.Data.DataRow TagRow in TagsTable.Rows) { Lfx.Data.Row ActionRow = (Lfx.Data.Row)TagRow; Lazaro.Pres.Forms.FormAction NewAction = new Lazaro.Pres.Forms.FormAction(ActionRow.Fields["label"].ValueString, null, ActionRow.Fields["label"].ValueString, 0); switch (ActionRow.Fields["inputtype"].ValueString) { case "primary": case "pri": NewAction.Visibility = Lazaro.Pres.Forms.FormActionVisibility.Main; break; case "tertiary": case "ter": NewAction.Visibility = Lazaro.Pres.Forms.FormActionVisibility.Tertiary; break; case "secondary": case "sec": default: NewAction.Visibility = Lazaro.Pres.Forms.FormActionVisibility.Secondary; break; } NewAction.Extra = ActionRow.Fields["extra"].ValueString; m_FormActions.Add(NewAction); } } } } return(m_FormActions.ShallowClone()); }
public virtual Lazaro.Pres.Forms.FormActionCollection GetFormActions() { if (m_FormActions == null) { m_FormActions = new Lazaro.Pres.Forms.FormActionCollection(); // Obtengo una lista de acciones basadas en la tabla sys_tags if (this.ElementoTipo != null && Lfx.Data.DataBaseCache.DefaultCache.Tables.ContainsKey("sys_tags")) { Lbl.Atributos.Datos AttrDatos = this.ElementoTipo.GetAttribute<Lbl.Atributos.Datos>(); if (AttrDatos != null) { string NombreTabla = AttrDatos.TablaDatos; System.Data.DataTable TagsTable = Lfx.Workspace.Master.MasterConnection.Select("SELECT * FROM sys_tags WHERE fieldtype IN ('action') AND tablename='" + NombreTabla + "'"); foreach (System.Data.DataRow TagRow in TagsTable.Rows) { Lfx.Data.Row ActionRow = (Lfx.Data.Row)TagRow; Lazaro.Pres.Forms.FormAction NewAction = new Lazaro.Pres.Forms.FormAction(ActionRow.Fields["label"].ValueString, null, ActionRow.Fields["label"].ValueString, 0); switch(ActionRow.Fields["inputtype"].ValueString) { case "primary": case "pri": NewAction.Visibility = Lazaro.Pres.Forms.FormActionVisibility.Main; break; case "tertiary": case "ter": NewAction.Visibility = Lazaro.Pres.Forms.FormActionVisibility.Tertiary; break; case "secondary": case "sec": default: NewAction.Visibility = Lazaro.Pres.Forms.FormActionVisibility.Secondary; break; } NewAction.Extra = ActionRow.Fields["extra"].ValueString; m_FormActions.Add(NewAction); } } } } return m_FormActions.ShallowClone(); }