protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = "";
                try
                {
                    id = Request.QueryString["id"].ToString();
                }
                catch
                {
                    Response.Redirect("Error.aspx");
                }


                if (String.IsNullOrEmpty(id))
                {
                    Response.Redirect("Error.aspx");
                }

                this.hdnBaseViewID.Value = id;

                try
                {
                }
                catch { }

                try
                {
                    this.hdnUserName.Value = Session["userFullName"].ToString();
                }
                catch { }

                DataTable dt = SynapseHelpers.GetBaseviewDTByID(id);

                try
                {
                    this.txtSQL.Text = dt.Rows[0]["baseviewsqlstatement"].ToString();
                }
                catch { }

                this.lblSummaryType.Text          = SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
                this.hdnNamespaceID.Value         = SynapseHelpers.GetBaseviewNameSpaceIDFromBaseViewID(id);
                this.hdnNextOrdinalPosition.Value = SynapseHelpers.GetNextOrdinalPositionFromID(id);
                this.lblBaseViewName.Text         = SynapseHelpers.GetBaseviewNameFromID(id);
                this.lblNamespaceName.Text        = SynapseHelpers.GetBaseviewNameSpaceNameFromBaseViewID(id);
                this.lblBaseViewComments.Text     = SynapseHelpers.GetBaseviewCommentsFromBaseViewID(id);


                this.lblError.Text              = string.Empty;
                this.lblError.Visible           = false;
                this.lblSuccess.Visible         = false;
                this.btnCreateNewEntity.Visible = false;
                this.btnCancel.Visible          = false;

                this.btnValidateEntity.Attributes.Add("onclick", "if(confirm('This will start the process of dropping and recreating the BaseView. Are you sure that you want to continue?')){return true;} else {return false;};");
                this.btnCreateNewEntity.Attributes.Add("onclick", "if(confirm('This will drop and recreate the BaseView. There is currently no validation to ensure that all previous attributes have been maintained in the new statement.  Are you sure that you want to continue?')){return true;} else {return false;};");
            }
        }
Ejemplo n.º 2
0
        public IActionResult BaseViewManagerSQL(string id)
        {
            ViewBag.Id  = id;
            namespaceId = id;
            BaseViewSQLModel model = new BaseViewSQLModel();
            DataTable        dt    = SynapseHelpers.GetBaseviewDTByID(id);

            model.SQL                 = dt.Rows[0]["baseviewsqlstatement"].ToString();
            model.Summary             = SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
            model.NamespaceId         = SynapseHelpers.GetBaseviewNameSpaceIDFromBaseViewID(id);
            model.NextOrdinalPosition = SynapseHelpers.GetNextOrdinalPositionFromID(id);
            model.ViewName            = SynapseHelpers.GetBaseviewNameFromID(id);
            model.NamespaceName       = SynapseHelpers.GetBaseviewNameSpaceNameFromBaseViewID(id);
            model.BaseViewComments    = SynapseHelpers.GetBaseviewCommentsFromBaseViewID(id);
            return(View(model));
        }