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

                this.lblSummaryType.Text = SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);

                this.hdnNextOrdinalPosition.Value = SynapseHelpers.GetNextOrdinalPositionFromID(id);

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

                this.hlGetList.Text        = this.hdnAPIURL.Value + "/GetBaseViewList/" + SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
                this.hlGetList.NavigateUrl = this.hlGetList.Text;

                this.hlGetListByID.Text        = this.hdnAPIURL.Value + "/GetBaseViewListObjectByAttribute/" + SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id) + "?synapseattributename={synapseattributename}&attributevalue={attributevalue}";
                this.hlGetListByID.NavigateUrl = this.hlGetListByID.Text;

                this.hlPostObject.Text        = this.hdnAPIURL.Value + "/GetBaseViewListByPost/" + SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
                this.hlPostObject.NavigateUrl = this.hlPostObject.Text;
            }
        }
Esempio n. 2
0
        public IActionResult BaseViewManagerAPI(string id)
        {
            ViewBag.Id  = id;
            namespaceId = id;
            BaseviewAPI aPIModel = new BaseviewAPI();
            DataTable   dt       = SynapseHelpers.GetBaseviewDTByID(id);

            ViewBag.Summary             = SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
            ViewBag.NextOrdinalPosition = SynapseHelpers.GetNextOrdinalPositionFromID(id);

            string apiURL = SynapseHelpers.GetAPIURL();

            aPIModel.GetList            = apiURL + "/GetBaseViewList/" + SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
            aPIModel.GetListByAttribute = apiURL + "/GetBaseViewListObjectByAttribute/" + SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id) + "?synapseattributename={synapseattributename}&attributevalue={attributevalue}";
            aPIModel.PostObject         = apiURL + "/GetBaseViewListByPost/" + SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
            return(View(aPIModel));
        }
Esempio n. 3
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));
        }
        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();
            }
        }
Esempio n. 5
0
        private void GetPreviewURL()
        {
            string  sql       = "SELECT * FROM eboards.bedboard WHERE bedboard_id = @bedboard_id;";
            DataSet ds        = new DataSet();
            var     paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("bedboard_id", hdnBedBoardID.Value)
            };

            try
            {
                ds = DataServices.DataSetFromSQL(sql, paramList);
            }
            catch (Exception ex)
            {
                StringBuilder sbe = new StringBuilder();
                sbe.AppendLine("<div class='contentAlertDanger'><h3 style='color: #712f2f'>Sorry, there was an error:</h3>");
                sbe.AppendLine(ex.ToString());
                sbe.AppendLine("</div>");
                //this.ltrlError.Visible = true;
                //this.ltrlError.Text = sbe.ToString();
                return;
            }

            DataTable dt = ds.Tables[0];

            string baseview_id = "";

            try
            {
                baseview_id = dt.Rows[0]["baseview_id"].ToString();
            }
            catch { }

            string baseviewname = SynapseHelpers.GetBaseViewNameAndNamespaceFromID(baseview_id);



            string PersonIDField = "";

            try
            {
                PersonIDField = dt.Rows[0]["baseviewpersonidfield"].ToString();
            }
            catch { }

            string EncounterIDField = "";

            try
            {
                EncounterIDField = dt.Rows[0]["baseviewencounteridfield"].ToString();
            }
            catch { }

            string WardField = "";

            try
            {
                WardField = dt.Rows[0]["baseviewwardfield"].ToString();
            }
            catch { }

            string BedField = "";

            try
            {
                BedField = dt.Rows[0]["baseviewbedfield"].ToString();
            }
            catch { }


            string sqlBoard = "SELECT " + WardField + " as WardField, " + BedField + " as BedField" +
                              " FROM baseview." + baseviewname + " order by random() LIMIT 1;";

            var paramListbOARD = new List <KeyValuePair <string, string> >()
            {
            };

            DataSet dsBoard = new DataSet();

            try
            {
                dsBoard = DataServices.DataSetFromSQL(sqlBoard, paramListbOARD);
            }
            catch (Exception ex)
            {
                StringBuilder sbe = new StringBuilder();
                sbe.AppendLine("<div class='contentAlertDanger'><h3 style='color: #712f2f'>Sorry, there was an error:</h3>");
                sbe.AppendLine(ex.ToString());
                sbe.AppendLine("</div>");
                //this.ltrlError.Visible = true;
                //this.ltrlError.Text = sbe.ToString();
                return;
            }

            DataTable dtBoard = dsBoard.Tables[0];

            string ward = "";

            try
            {
                ward = dtBoard.Rows[0]["WardField"].ToString();
            }
            catch { }

            string bed = "";

            try
            {
                bed = dtBoard.Rows[0]["BedField"].ToString();
            }
            catch { }

            string apiURL = SynapseHelpers.GetAPIURL();

            string uri = SynapseHelpers.GetEBoardURL() + "bedboard.aspx?BedBoardID=" + this.hdnBedBoardID.Value + "&Ward=" + ward + "&Bed=" + bed;

            this.hlPreview.NavigateUrl = uri;
        }
Esempio n. 6
0
        private string GetPreviewURL(string bedBoardId)
        {
            string  sql       = "SELECT * FROM eboards.bedboard WHERE bedboard_id = @bedboard_id;";
            DataSet ds        = new DataSet();
            var     paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("bedboard_id", bedBoardId)
            };

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

            try
            {
                baseview_id = dt.Rows[0]["baseview_id"].ToString();
            }
            catch { }
            string baseviewname  = SynapseHelpers.GetBaseViewNameAndNamespaceFromID(baseview_id);
            string PersonIDField = "";

            try
            {
                PersonIDField = dt.Rows[0]["baseviewpersonidfield"].ToString();
            }
            catch { }

            string EncounterIDField = "";

            try
            {
                EncounterIDField = dt.Rows[0]["baseviewencounteridfield"].ToString();
            }
            catch { }

            string WardField = "";

            try
            {
                WardField = dt.Rows[0]["baseviewwardfield"].ToString();
            }
            catch { }

            string BedField = "";

            try
            {
                BedField = dt.Rows[0]["baseviewbedfield"].ToString();
            }
            catch { }


            string sqlBoard = "SELECT " + WardField + " as WardField, " + BedField + " as BedField" +
                              " FROM baseview." + baseviewname + " order by random() LIMIT 1;";

            var paramListbOARD = new List <KeyValuePair <string, string> >()
            {
            };

            DataSet dsBoard = DataServices.DataSetFromSQL(sqlBoard, paramListbOARD);

            DataTable dtBoard = dsBoard.Tables[0];

            string ward = "";

            try
            {
                ward = dtBoard.Rows[0]["WardField"].ToString();
            }
            catch { }

            string bed = "";

            try
            {
                bed = dtBoard.Rows[0]["BedField"].ToString();
            }
            catch { }

            string apiURL = SynapseHelpers.GetAPIURL();

            string uri = SynapseHelpers.GetEBoardURL() + "bedboard.aspx?BedBoardID=" + bedBoardId + "&Ward=" + ward + "&Bed=" + bed;

            return(uri);
        }