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;};");
            }
        }
        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;
            }
        }
Example #3
0
        public IActionResult BaseViewManagerAttribute(string id)
        {
            ViewBag.Id  = id;
            namespaceId = id;
            string sql       = "SELECT * FROM listsettings.baseviewattribute WHERE baseview_id = @baseview_id ORDER BY ordinalposition;";
            var    paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("baseview_id", id)
            };
            DataSet ds = DataServices.DataSetFromSQL(sql, paramList);

            ViewBag.BaseviewNamespaceName = SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
            List <BaseViewAttributeDto> BaseViewAttributeDto = ds.Tables[0].ToList <BaseViewAttributeDto>();

            return(View(BaseViewAttributeDto));
        }
Example #4
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));
        }
Example #5
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.hdnBaseViewID.Value = id;

                try
                {
                }
                catch { }

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


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

                BindGrid();

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

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

                this.lblError.Visible   = false;
                this.lblSuccess.Visible = false;
            }
        }
Example #6
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));
        }
Example #7
0
        public IActionResult BaseViewManagerView(string id)
        {
            ViewBag.Id  = id;
            namespaceId = id;
            string sql       = "SELECT * FROM listsettings.v_baseviewdetailsummary WHERE baseview_id = @baseview_id ORDER BY orderby";
            var    paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("baseview_id", id)
            };
            DataSet       ds            = DataServices.DataSetFromSQL(sql, paramList);
            BaseViewModel baseViewModel = new BaseViewModel();

            baseViewModel.BaseviewNamespaceName = SynapseHelpers.GetBaseViewNameAndNamespaceFromID(id);
            List <BaseViewDetailDto> BaseViewDetailDto = ds.Tables[0].ToList <BaseViewDetailDto>();

            baseViewModel.BaseViewDetailDto = BaseViewDetailDto;
            return(View(baseViewModel));
        }
        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 { }


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

                BindBaseViewGrid();

                //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 #9
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;
        }
Example #10
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);
        }