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"]);

        }
		private void detach_ReportColumnsSchemas(ReportColumnsSchema entity)
		{
			this.SendPropertyChanging();
			entity.ReportTablesSchema = null;
		}
 partial void DeleteReportColumnsSchema(ReportColumnsSchema instance);
 partial void UpdateReportColumnsSchema(ReportColumnsSchema instance);
 partial void InsertReportColumnsSchema(ReportColumnsSchema instance);
		private void attach_ReportColumnsSchemas(ReportColumnsSchema entity)
		{
			this.SendPropertyChanging();
			entity.ReportDataType = this;
		}