private void btnAdd_Click(object sender, EventArgs e) { if (cmbCampos.SelectedIndex >= 0) { DataRowView row = (DataRowView)cmbCampos.SelectedItem; string tipo = row["X3_TIPO"].ToString().ToUpper(); string len = row["X3_TAMANHO"].ToString(); string obj = FormatScreen.getObjectFromSigaType(tipo).GetType().ToString(); REPORT.Params.ParamsVo parm = new REPORT.Params.ParamsVo(); parm.MAINID = this.MAIN.ID; parm.TAMANHO = int.Parse(len); parm.TABELA = this.MAIN.TABLE; parm.CAMPO = this.cmbCampos.SelectedValue.ToString(); parm.FORMATO = tipo; parm.OBJETO = obj; this.MAIN.THISTABLE.PARAMS.Add(parm); dados.Rows.Add(0 //id , this.MAIN.ID //id da ligação , len //tamanho de digitação , this.MAIN.TABLE //nome da tabela , this.cmbCampos.SelectedValue.ToString() //campo , tipo //formato , obj //objeto ); } }
private void popScreenFromRecursiveTables() { panelParams.Controls.Clear(); REPORT.Table.TableVo tabela = new REPORT.Table.TableVo(); new REPORT.Table.TableDao().load(tabela, this.RELATORIO.ID, 0); DataTable tabelas = new REPORT.Params.ParamsDao().getRecursiveTables(tabela, "userParms_" + sigaSession.LoggedUser.ID, tabela.ID); if (tabelas.DefaultView.Count == 0) { btnExec_Click(null, null); destroy = true; } foreach (DataRow row in tabelas.Rows) { string tagFormat = "@$TAB$@.$CAMPO$ ?? '@?@'"; string controle = (string)row["formato"]; string strNomeCampo = new SigaObjects .SXManager(sigaSession.EMPRESAS[0].CODIGO) .getFields((string)row["tabela"], SigaObjects.SXManager.FieldValueMember + " = '" + (string)row["campo"] + "'" , null) .Rows[0][SigaObjects.SXManager.FieldDisplayMember].ToString(); // // CONTROLE DE Control cDE = FormatScreen.getObjectFromSigaType(controle); string lblDE = strNomeCampo + "\t\t Entre \t\t"; cDE.Tag = tagFormat .Replace("$TAB$", (string)row["tabela"]) .Replace("$CAMPO$", (string)row["campo"]) .Replace("??", ">="); FormatScreen.AddControl(panelParams, new Label(lblDE), true, 3, false, false); FormatScreen.AddControl(panelParams, cDE, true, 3, false, false); // // CONTROLE ATE Control cATE = FormatScreen.getObjectFromSigaType(controle); string lblATE = string.Format("{0,50}", "e"); cATE.Tag = tagFormat .Replace("$TAB$", (string)row["tabela"]) .Replace("$CAMPO$", (string)row["campo"]) .Replace("??", "<="); //FormatScreen.AddControl(panelParams, new Label(lblATE),true, 4, false, false); FormatScreen.AddControl(panelParams, cATE, true, 3, false, false); } }
private void cbFields_SelectedIndexChanged(object sender, EventArgs e) { if (cbFields.SelectedIndex >= 0) { DataRow row = (cbFields.DataSource as DataView).Table.Rows[cbFields.SelectedIndex]; int left = txtFilter.Left; int top = txtFilter.Top; panel1.Controls.Remove(txtFilter); txtFilter = FormatScreen.getObjectFromSigaType((string)row["X3_TIPO"]); txtFilter.Update(); txtFilter.Left = left; txtFilter.Top = top; panel1.Controls.Add(txtFilter); } }