protected void btnSave_Click(object sender, EventArgs e)
        {
            ReportTablesSchema original_reportTablesSchema = new ReportTablesSchema();
            reportsManager = new ReportsManager(this);
            reportTablesSchema = new ReportTablesSchema();

            if (reportTablesSchemaId != 0)
            {
                original_reportTablesSchema = reportsManager.GetTableSchema(reportTablesSchemaId);
                reportTablesSchema.CopyPropertiesFrom(original_reportTablesSchema);

            }

            reportTablesSchema.Name = txtName.Text;
            reportTablesSchema.SqlText = txtSqltext.Text;

            if (reportTablesSchemaId != 0)
                reportsManager.Update(original_reportTablesSchema, reportTablesSchema);
            else
            {
                reportsManager.Insert(reportTablesSchema);
                Response.Redirect("DynamicReport.aspx?ReportTablesSchemaId=" + reportTablesSchema.ReportTablesSchemaId);
            }


            // Server.Transfer("dynamicReports.aspx");
            // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "location='Customer.aspx?CustomerId=" + customer.CustomerId + "';", true);

        }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ReportTablesSchema original_reportTablesSchema = new ReportTablesSchema();

            reportsManager     = new ReportsManager(this);
            reportTablesSchema = new ReportTablesSchema();

            if (reportTablesSchemaId != 0)
            {
                original_reportTablesSchema = reportsManager.GetTableSchema(reportTablesSchemaId);
                reportTablesSchema.CopyPropertiesFrom(original_reportTablesSchema);
            }

            reportTablesSchema.Name    = txtName.Text;
            reportTablesSchema.SqlText = txtSqltext.Text;

            if (reportTablesSchemaId != 0)
            {
                reportsManager.Update(original_reportTablesSchema, reportTablesSchema);
            }
            else
            {
                reportsManager.Insert(reportTablesSchema);
                Response.Redirect("DynamicReport.aspx?ReportTablesSchemaId=" + reportTablesSchema.ReportTablesSchemaId);
            }


            // Server.Transfer("dynamicReports.aspx");
            // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "location='Customer.aspx?CustomerId=" + customer.CustomerId + "';", true);
        }
        protected void btnSaveReportColumnsSchema_Click(object sender, EventArgs e)
        {

            var reportsManager = new ReportsManager(this);
            var reportColumnsSchema = new ReportColumnsSchema();
            ReportColumnsSchema original_reportColumnsSchema = new ReportColumnsSchema();

            if (reportTablesSchemaId > 0)
            {
                original_reportColumnsSchema = reportsManager.GetColumnSchema(reportTablesSchemaId, reportColumnsSchemaId);
                reportColumnsSchema.CopyPropertiesFrom(original_reportColumnsSchema);
            }

            reportColumnsSchema.ReportTablesSchemaId = reportTablesSchemaId;

            reportColumnsSchema.Name = txtReportColumnsSchemaName.Text;
            reportColumnsSchema.Source = txtSource.Text;
            reportColumnsSchema.ReportDataTypeId = Convert.ToInt32(cboReportDataType.SelectedValue);
            reportColumnsSchema.ForeignKey = txtForeignKey.Text;
            reportColumnsSchema.PrimaryKey = txtPrimaryKey.Text;
            reportColumnsSchema.PrimaryTable = txtPrimaryTable.Text;
            reportColumnsSchema.PrimaryLabelColumn = txtPrimaryLabelColumn.Text;

            if (reportColumnsSchemaId > 0)
                reportsManager.Update(original_reportColumnsSchema, reportColumnsSchema);
            else
                reportsManager.Insert(reportColumnsSchema);

            Response.Redirect("DynamicReportFields.aspx?ReportTablesSchemaId=" + Request["ReportTablesSchemaId"]);

        }
Ejemplo n.º 4
0
        protected void btnSaveReportColumnsSchema_Click(object sender, EventArgs e)
        {
            var reportsManager      = new ReportsManager(this);
            var reportColumnsSchema = new ReportColumnsSchema();
            ReportColumnsSchema original_reportColumnsSchema = new ReportColumnsSchema();

            if (reportTablesSchemaId > 0)
            {
                original_reportColumnsSchema = reportsManager.GetColumnSchema(reportTablesSchemaId, reportColumnsSchemaId);
                reportColumnsSchema.CopyPropertiesFrom(original_reportColumnsSchema);
            }

            reportColumnsSchema.ReportTablesSchemaId = reportTablesSchemaId;

            reportColumnsSchema.Name               = txtReportColumnsSchemaName.Text;
            reportColumnsSchema.Source             = txtSource.Text;
            reportColumnsSchema.ReportDataTypeId   = Convert.ToInt32(cboReportDataType.SelectedValue);
            reportColumnsSchema.ForeignKey         = txtForeignKey.Text;
            reportColumnsSchema.PrimaryKey         = txtPrimaryKey.Text;
            reportColumnsSchema.PrimaryTable       = txtPrimaryTable.Text;
            reportColumnsSchema.PrimaryLabelColumn = txtPrimaryLabelColumn.Text;

            if (reportColumnsSchemaId > 0)
            {
                reportsManager.Update(original_reportColumnsSchema, reportColumnsSchema);
            }
            else
            {
                reportsManager.Insert(reportColumnsSchema);
            }

            Response.Redirect("DynamicReportFields.aspx?ReportTablesSchemaId=" + Request["ReportTablesSchemaId"]);
        }