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.hdnAttributeID.Value = id;

                this.hdnEntityID.Value = SynapseHelpers.GetEntityIDFromAttributeID(id);

                this.lblHeading.Text = SynapseHelpers.GetAttributeNameFromAttributeID(id);

                this.lblAttributeName.Text = SynapseHelpers.GetAttributeNameFromAttributeID(id);


                try
                {
                }
                catch { }

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


                this.lblSummaryType.Text          = SynapseHelpers.GetEntityNameAndNamespaceFromID(id);
                this.hdnNextOrdinalPosition.Value = SynapseHelpers.GetNextOrdinalPositionFromID(id);

                BindGrid();

                this.btnDropAttribute.Attributes.Add("onclick", "if(confirm('Are you sure that you want to delete this relation? This cannot be undone!!')){return true;} else {return false;};");
            }
        }
Exemplo n.º 2
0
        public IActionResult EntityManagerAttributeView(string id)
        {
            namespaceId           = SynapseHelpers.GetEntityIDFromAttributeID(id);
            ViewBag.Id            = namespaceId;
            ViewBag.AttributeId   = id;
            ViewBag.Heading       = SynapseHelpers.GetAttributeNameFromAttributeID(id);
            ViewBag.AttributeName = SynapseHelpers.GetAttributeNameFromAttributeID(id);

            ViewBag.Summary = SynapseHelpers.GetEntityNameAndNamespaceFromID(namespaceId);

            string sql       = "SELECT * FROM entitysettings.v_attributedetailsummary WHERE attributeid = @attributeid ORDER BY orderby";
            var    paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("attributeid", id)
            };

            DataSet   ds = DataServices.DataSetFromSQL(sql, paramList);
            DataTable dt = ds.Tables[0];

            ViewBag.Error = "";
            foreach (DataRow drow in dt.Rows)
            {
                string colName = drow["entitydetail"].ToString();
                string colVal  = drow["entitydescription"].ToString();

                if (colName == "Is Key Attribute")
                {
                    if (colVal == "1")
                    {
                        ViewBag.Error = "Drop Attribute button not available as it is not possible to delete a key attribute";
                    }
                }

                if (colName == "Is System Attribute")
                {
                    if (colVal == "1")
                    {
                        ViewBag.Error = "Drop Attribute button not available as it is not possible to delete a system attribute";
                    }
                }

                if (colName == "Is Relation Attribute")
                {
                    if (colVal == "1")
                    {
                        ViewBag.Error = "Drop Attribute button not available as it is not possible to delete a relation attribute from this screen";
                    }
                }
            }


            DataTable          dtBVs       = SynapseHelpers.GetEntityBaseviewsDT(namespaceId);
            Int16              bvCount     = System.Convert.ToInt16(dtBVs.Rows.Count);
            DetailModel        detailModel = new DetailModel();
            List <DetailDto>   detailDto   = dt.ToList <DetailDto>();
            List <BaseViewDto> baseViewDto = dtBVs.ToList <BaseViewDto>();

            detailModel.DetailDto   = detailDto;
            detailModel.BaseViewDto = baseViewDto;
            return(View(detailModel));
        }
Exemplo n.º 3
0
        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.hdnAttributeID.Value = id;

                this.hdnEntityID.Value = SynapseHelpers.GetEntityIDFromAttributeID(id);

                this.lblHeading.Text = SynapseHelpers.GetAttributeNameFromAttributeID(id);

                this.lblAttributeName.Text = SynapseHelpers.GetAttributeNameFromAttributeID(id);


                try
                {
                }
                catch { }

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


                this.lblSummaryType.Text          = SynapseHelpers.GetEntityNameAndNamespaceFromID(id);
                this.hdnNextOrdinalPosition.Value = SynapseHelpers.GetNextOrdinalPositionFromID(id);

                BindGrid();

                this.btnDropAttribute.Attributes.Add("onclick", "if(confirm('Are you sure that you want to delete this attribute? This cannot be undone!!')){return true;} else {return false;};");


                DataTable dtBVs   = SynapseHelpers.GetEntityBaseviewsDT(this.hdnEntityID.Value);
                Int16     bvCount = System.Convert.ToInt16(dtBVs.Rows.Count);
                this.lblDependentBaseviewCount.Text = bvCount.ToString();
                this.lblHasDepencies.Text           = bvCount.ToString();

                if (bvCount > 0)
                {
                    this.pnlHasDepencies.Visible = true;
                }
                else
                {
                    this.pnlHasDepencies.Visible = false;
                }

                this.dgBaseViewDependancies.DataSource = dtBVs;
                this.dgBaseViewDependancies.DataBind();
            }
        }