Example #1
0
        public IActionResult EntityManagerRelation(string id)
        {
            ViewBag.Id  = id;
            namespaceId = id;
            DataSet ds = DataServices.DataSetFromSQL("SELECT * FROM entitysettings.synapsenamespace WHERE synapsenamespaceid <> 'e8b78b52-641d-46eb-bb8b-16e2feb86fe7' ORDER BY synapsenamespacename");

            ViewBag.SynapseNamespaceList = ToSelectList(ds.Tables[0], "SynapseNamespaceId", "SynapseNamespaceName");
            ViewBag.EntityList           = new SelectList(new List <SelectListItem> {
            });
            DataSet dsAttribute = DataServices.DataSetFromSQL("SELECT entityid, attributeid, attributename FROM entitysettings.entityattribute WHERE entityid='" + id + "' AND coalesce(isrelationattribute,0) = 0 ORDER BY attributename;");

            ViewBag.AttributeList = ToSelectList(dsAttribute.Tables[0], "AttributeId", "AttributeName");
            ViewBag.Summary       = SynapseHelpers.GetEntityNameAndNamespaceFromID(id);
            string sql       = "SELECT * FROM entitysettings.v_relationsattributes WHERE entityid = @entityid ORDER BY entityname;";
            var    paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("entityid", id)
            };

            DataSet            dsRelation    = DataServices.DataSetFromSQL(sql, paramList);
            RelationModel      relationModel = new RelationModel();
            List <RelationDto> relationDto   = dsRelation.Tables[0].ToList <RelationDto>();

            relationModel.RelationDto = relationDto;
            return(View(relationModel));
        }
Example #2
0
        public IActionResult EntityManagerModel(string id)
        {
            ViewBag.Id  = id;
            namespaceId = id;
            ClassDataModel classDataModel = new ClassDataModel();

            ViewBag.Summary = SynapseHelpers.GetEntityNameAndNamespaceFromID(id);
            string sqlcSharp       = "SELECT entitysettings.getcsharpmodel(@entityid);";
            var    paramListcSharp = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("entityid", id)
            };

            DataSet   dsCSharp = DataServices.DataSetFromSQL(sqlcSharp, paramListcSharp);
            DataTable dtcSharp = dsCSharp.Tables[0];

            classDataModel.CSharp = dtcSharp.Rows[0][0].ToString();
            string sql       = "SELECT entitysettings.getswiftmodel(@entityid);";
            var    paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("entityid", id)
            };
            DataSet   ds = DataServices.DataSetFromSQL(sql, paramList);
            DataTable dt = ds.Tables[0];

            classDataModel.Swift = dt.Rows[0][0].ToString();
            return(View(classDataModel));
        }
Example #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.hdnEntityID.Value = id;

                try
                {
                }
                catch { }

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


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

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

                BindDropDownList(this.ddlSynapseNamespace, "SELECT * FROM entitysettings.synapsenamespace WHERE synapsenamespaceid <> 'e8b78b52-641d-46eb-bb8b-16e2feb86fe7' ORDER BY synapsenamespacename", "synapsenamespaceid", "synapsenamespacename", 1);
                BindDropDownList(this.ddlEntity, "SELECT entityid, entityname FROM entitysettings.entitymanager WHERE synapsenamespaceid = '" + this.ddlSynapseNamespace.SelectedValue + "' ORDER BY entityname", "entityid", "entityname", 1);

                BindDropDownListNone(this.ddlLocalAttribute, "SELECT entityid, attributeid, attributename FROM entitysettings.entityattribute WHERE entityid='" + this.hdnEntityID.Value + "' AND coalesce(isrelationattribute,0) = 0 ORDER BY attributename;", "attributeid", "attributename", 1);

                BindEntityGrid();

                //this.btnCreateNewAttribute.Attributes.Add("onclick", "if(confirm('Are you sure that you want to add the attribute as defined? This cannot be undone!!')){return true;} else {return false;};");
            }
        }
Example #4
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.hdnEntityID.Value = id;

                try
                {
                }
                catch { }

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


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

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

                BindDropDownList(this.ddlDataType, "SELECT * FROM entitysettings.systemdatatype WHERE availabletoenduser = true ORDER BY orderby", "datatypeID", "datatypedisplay", 1);
                BindEntityGrid();

                //this.btnCreateNewAttribute.Attributes.Add("onclick", "if(confirm('Are you sure that you want to add the attribute as defined? This cannot be undone!!')){return true;} else {return false;};");
            }
        }
        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;};");
            }
        }
Example #6
0
        public IActionResult EntityManagerView(string id)
        {
            ViewBag.Id  = id;
            namespaceId = id;
            string sql       = "SELECT * FROM entitysettings.v_entitydetailsummary WHERE entityid = @entityid ORDER BY orderby";
            var    paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("entityid", id)
            };

            ViewBag.Summary = SynapseHelpers.GetEntityNameAndNamespaceFromID(id);
            DataSet            dsEntityDetail = DataServices.DataSetFromSQL(sql, paramList);
            DataTable          dtBVs          = SynapseHelpers.GetEntityBaseviewsDT(id);
            DetailModel        detailModel    = new DetailModel();
            List <DetailDto>   detailDto      = dsEntityDetail.Tables[0].ToList <DetailDto>();
            List <BaseViewDto> baseViewDto    = dtBVs.ToList <BaseViewDto>();

            detailModel.DetailDto   = detailDto;
            detailModel.BaseViewDto = baseViewDto;
            return(View(detailModel));
        }
Example #7
0
        public IActionResult EntityManagerAttribute(string id)
        {
            ViewBag.Id  = id;
            namespaceId = id;
            DataSet ds = DataServices.DataSetFromSQL("SELECT * FROM entitysettings.systemdatatype WHERE availabletoenduser = true ORDER BY orderby");

            ViewBag.SystemDataTypeList = ToSelectList(ds.Tables[0], "DataTypeID", "DataTypeDisplay");
            ViewBag.Summary            = SynapseHelpers.GetEntityNameAndNamespaceFromID(id);
            string sql       = "SELECT * FROM entitysettings.v_entityattribute WHERE entityid = @entityid ORDER BY ordinal_position;";
            var    paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("entityid", id)
            };

            DataSet             dsAttribute    = DataServices.DataSetFromSQL(sql, paramList);
            AttributeModel      attributeModel = new AttributeModel();
            List <AttributeDto> attributeDto   = dsAttribute.Tables[0].ToList <AttributeDto>();

            attributeModel.AttributeDtos = attributeDto;

            return(View(attributeModel));
        }
Example #8
0
        public IActionResult EntityManagerAPI(string id)
        {
            ViewBag.Id      = id;
            namespaceId     = id;
            ViewBag.Summary = SynapseHelpers.GetEntityNameAndNamespaceFromID(id);
            APIModel aPIModel = new APIModel();

            aPIModel.EntityName = SynapseHelpers.GetEntityNameFromID(id);
            aPIModel.Namespance = SynapseHelpers.GetNamepsaceFromEntityID(id);
            DataTable dtKey = SynapseHelpers.GetEntityKeyAttributeFromID(id);

            aPIModel.KeyAttribute = dtKey.Rows[0][1].ToString();
            string apiURL = SynapseHelpers.GetAPIURL();

            aPIModel.GetList                 = apiURL + "/GetList" + "?synapsenamespace=" + aPIModel.Namespance + "&synapseentityname=" + aPIModel.EntityName;
            aPIModel.GetObject               = apiURL + "/GetObject" + "?synapsenamespace=" + aPIModel.Namespance + "&synapseentityname=" + aPIModel.EntityName + "&id={" + aPIModel.KeyAttribute + "}";
            aPIModel.GetListByAttribute      = apiURL + "/GetListByAttribute" + "?synapsenamespace=" + aPIModel.Namespance + "&synapseentityname=" + aPIModel.EntityName + "&synapseattributename={synapseattributename}&attributevalue={attributevalue}";
            aPIModel.PostObject              = apiURL + "/PostObject" + "?synapsenamespace=" + aPIModel.Namespance + "&synapseentityname=" + aPIModel.EntityName;
            aPIModel.DeleteObject            = apiURL + "/DeleteObject" + "?synapsenamespace=" + aPIModel.Namespance + "&synapseentityname=" + aPIModel.EntityName + "&id={" + aPIModel.KeyAttribute + "}";
            aPIModel.DeleteObjectByAttribute = apiURL + "/DeleteObjectByAttribute" + "?synapsenamespace=" + aPIModel.Namespance + "&synapseentityname=" + aPIModel.EntityName + "&synapseattributename={synapseattributename}&attributevalue={attributevalue}";
            aPIModel.GetObjectHistory        = apiURL + "/GetObjectHistory" + "?synapsenamespace=" + aPIModel.Namespance + "&synapseentityname=" + aPIModel.EntityName + "&id={" + aPIModel.KeyAttribute + "}";
            aPIModel.SamplePostJson          = SynapseHelpers.GetEntitySampleJSON(id).Rows[0][0].ToString();
            return(View(aPIModel));
        }
Example #9
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));
        }
Example #10
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.hdnEntityID.Value = 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.btnDropEntity.Attributes.Add("onclick", "if(confirm('Are you sure that you want to delete this entity? This cannot be undone!!')){return true;} else {return false;};");

                this.btnShowDeleteEntity.Attributes.Add("onclick", "if(confirm('Are you sure that you want to enable the delete functionality?')){alert('Delete enabled'); return true;} else {return false;};");

                DataTable dtBVs   = SynapseHelpers.GetEntityBaseviewsDT(id);
                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;
                    this.btnShowDeleteEntity.Visible = false;
                }
                else
                {
                    this.pnlHasDepencies.Visible     = false;
                    this.btnShowDeleteEntity.Visible = true;
                }

                this.dgBaseViewDependancies.DataSource = dtBVs;
                this.dgBaseViewDependancies.DataBind();
            }
        }
        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.hdnEntityID.Value = id;

                try
                {
                }
                catch { }

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


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

                this.hdnEntityName.Value = SynapseHelpers.GetEntityNameFromID(id);
                this.hdnNamespace.Value  = SynapseHelpers.GetNamepsaceFromEntityID(id);

                DataTable dtKey = SynapseHelpers.GetEntityKeyAttributeFromID(id);
                this.hdnKeyAttribute.Value = dtKey.Rows[0][1].ToString();

                this.hdnAPIURL.Value = SynapseHelpers.GetAPIURL();

                this.hlGetList.Text        = this.hdnAPIURL.Value + "/GetList" + "?synapsenamespace=" + this.hdnNamespace.Value + "&synapseentityname=" + this.hdnEntityName.Value;
                this.hlGetList.NavigateUrl = this.hlGetList.Text;

                this.hlGetObject.Text        = this.hdnAPIURL.Value + "/GetObject" + "?synapsenamespace=" + this.hdnNamespace.Value + "&synapseentityname=" + this.hdnEntityName.Value + "&id={" + this.hdnKeyAttribute.Value + "}";
                this.hlGetObject.NavigateUrl = this.hlGetObject.Text;

                this.hlGetListByID.Text        = this.hdnAPIURL.Value + "/GetListByAttribute" + "?synapsenamespace=" + this.hdnNamespace.Value + "&synapseentityname=" + this.hdnEntityName.Value + "&synapseattributename={synapseattributename}&attributevalue={attributevalue}";
                this.hlGetListByID.NavigateUrl = this.hlGetListByID.Text;

                this.hlPostObject.Text        = this.hdnAPIURL.Value + "/PostObject" + "?synapsenamespace=" + this.hdnNamespace.Value + "&synapseentityname=" + this.hdnEntityName.Value;
                this.hlPostObject.NavigateUrl = this.hlPostObject.Text;

                this.hlDeleteObject.Text        = this.hdnAPIURL.Value + "/DeleteObject" + "?synapsenamespace=" + this.hdnNamespace.Value + "&synapseentityname=" + this.hdnEntityName.Value + "&id={" + this.hdnKeyAttribute.Value + "}";
                this.hlDeleteObject.NavigateUrl = this.hlDeleteObject.Text;

                this.hlDeleteByAttribute.Text   = this.hdnAPIURL.Value + "/DeleteObjectByAttribute" + "?synapsenamespace=" + this.hdnNamespace.Value + "&synapseentityname=" + this.hdnEntityName.Value + "&synapseattributename={synapseattributename}&attributevalue={attributevalue}";
                this.hlDeleteObject.NavigateUrl = this.hlDeleteObject.Text;

                this.hlGetObjectHistory.Text        = this.hdnAPIURL.Value + "/GetObjectHistory" + "?synapsenamespace=" + this.hdnNamespace.Value + "&synapseentityname=" + this.hdnEntityName.Value + "&id={" + this.hdnKeyAttribute.Value + "}";
                this.hlGetObjectHistory.NavigateUrl = this.hlGetObjectHistory.Text;


                this.lblentity1.Text = this.hdnEntityName.Value;
                this.lblentity2.Text = this.hdnEntityName.Value;
                this.lblentity3.Text = this.hdnEntityName.Value;
                this.lblentity4.Text = this.hdnEntityName.Value;
                this.lblentity5.Text = this.hdnEntityName.Value;
                this.lblentity6.Text = this.hdnEntityName.Value;

                this.lblnamespace1.Text = this.hdnNamespace.Value;
                this.lblnamespace2.Text = this.hdnNamespace.Value;
                this.lblnamespace3.Text = this.hdnNamespace.Value;
                this.lblnamespace4.Text = this.hdnNamespace.Value;
                this.lblnamespace5.Text = this.hdnNamespace.Value;
                this.lblnamespace6.Text = this.hdnNamespace.Value;

                this.lblkey1.Text = this.hdnKeyAttribute.Value;
                this.lblkey2.Text = this.hdnKeyAttribute.Value;
                this.lblkey3.Text = this.hdnKeyAttribute.Value;
                this.lblkey4.Text = this.hdnKeyAttribute.Value;
                this.lblkey5.Text = this.hdnKeyAttribute.Value;
                this.lblkey6.Text = this.hdnKeyAttribute.Value;

                this.divPostSample.InnerText = SynapseHelpers.GetEntitySampleJSON(id).Rows[0][0].ToString();
            }
        }