Beispiel #1
0
 protected void btnPreProcessExport_Click(object sender, EventArgs e)
 {
     if (!fImport.HasFile)
     {
         lblError.Text = "Please select a Synapse Schema Export file to process";
     }
     else
     {
         lblError.Text = string.Empty;
         showSelectObjects();
         Session.Remove("export");
         Export ex;
         try
         {
             ex = createObjectFromExport(fImport.PostedFile.InputStream);
             Session["Export"] = ex;
             SynapseHelpers.CompareSchema(ex, SynapseHelpers.DataSetSerializerType.Json);
             ConsentTreeView(ex);
         }
         catch (Exception ex1)
         {
             Session.Remove("export");
             lblError.Text  = ex1.Message;
             lblError.Text += "Please try a different export";
             showFileUpload();
         }
     }
 }
Beispiel #2
0
        public IActionResult VerifyLocalEntity(string entityName)
        {
            entityName = entityName == null ? "" : entityName;

            string localtablename = SynapseHelpers.GetLocalNamespaceNameFromID(localNamespaceIDSelected) + "_" + entityName;

            string sql = "SELECT * FROM entitysettings.entitymanager WHERE synapseNamespaceid = @synapseNamespaceid and entityname = @entityname;";

            var paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("synapseNamespaceid", namespaceId),
                new KeyValuePair <string, string>("entityname", localtablename)
            };

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

            if (dt.Rows.Count > 0)
            {
                //return Json("The name of the entity that you have entered already exists");
                return(Json("There is already a local entity called " + localtablename));
            }

            return(Json(true));
        }
Beispiel #3
0
        internal DataSet GetCurrentSchema()
        {
            DataSet idsFromName = SynapseHelpers.GetEntityIDsByName(string.Join("','", Entity.Select(x => x.Name.Trim()).ToList <string>()));

            var       allEntitiyIds = idsFromName.Tables[0].AsEnumerable().Select(x => x["entityid"].ToString()).ToList <string>();
            string    entityids     = string.Join("','", allEntitiyIds);
            DataSet   ds            = new DataSet();
            DataTable dt            = SynapseHelpers.GetEntityManager(entityids).Tables[0];

            if (dt != null)
            {
                ds.Tables.Add(dt.Copy());
            }
            dt = SynapseHelpers.GetEntityAttributes(entityids).Tables[0];
            if (dt != null)
            {
                ds.Tables.Add(dt.Copy());
            }
            dt = SynapseHelpers.GetEntityRelation(entityids).Tables[0];
            if (dt != null)
            {
                ds.Tables.Add(dt.Copy());
            }
            dt = SynapseHelpers.GetEntityNamespace(entityids).Tables[0];
            if (dt != null)
            {
                ds.Tables.Add(dt.Copy());
            }
            return(ds);
        }
        public IActionResult ImportFile(IFormFile formFile)
        {
            //lblError.Text = string.Empty;
            //showSelectObjects();
            //Session.Remove("export");
            Export ex;

            try
            {
                Stream       memoryStream = formFile.OpenReadStream();
                StreamReader sr           = new StreamReader(memoryStream);
                ex = SynapseHelpers.DeserialiseExport(sr.ReadToEnd());
                sr.Close(); sr.Dispose();
                SynapseHelpers.CompareSchema(ex, SynapseHelpers.DataSetSerializerType.Json);
                HttpContext.Session.SetString("ExportSchema", JsonConvert.SerializeObject(ex));
                ViewBag.Json = JsonConvert.SerializeObject(ConsentTreeView(ex));
            }
            catch (Exception ex1)
            {
                //Session.Remove("export");
                //lblError.Text = ex1.Message;
                // lblError.Text += "Please try a different export";
                //showFileUpload();
            }
            return(View("SchemaImport"));
        }
Beispiel #5
0
        public IActionResult EntityManagerAttributeDelete(string id)
        {
            DataTable dtBVs = SynapseHelpers.GetEntityBaseviewsDT(namespaceId);


            string sql = @"SELECT entitysettings.dropattributefromentity(
                                @p_attributeid,
	                            @p_entityid
                            )";



            var paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("p_attributeid", id),
                new KeyValuePair <string, string>("p_entityid", namespaceId)
            };

            DataServices.ExcecuteNonQueryFromSQL(sql, paramList);

            foreach (DataRow row in dtBVs.Rows)
            {
                string baseview_id       = row["baseview_id"].ToString();
                string sqlRecreate       = "SELECT listsettings.recreatebaseview(@baseview_id);";
                var    paramListRecreate = new List <KeyValuePair <string, string> >()
                {
                    new KeyValuePair <string, string>("baseview_id", baseview_id)
                };
                DataServices.ExcecuteNonQueryFromSQL(sqlRecreate, paramListRecreate);
            }

            return(RedirectToAction("EntityManagerAttribute", new { id = namespaceId }));
        }
Beispiel #6
0
        protected void btnCreateNewEntity_Click(object sender, EventArgs e)
        {
            string sql = "SELECT entitysettings.createentityfrommodel(@p_synapsenamespaceid, @p_synapsenamespacename, @p_entityname, @p_entitydescription, @p_username, @p_localnamespaceid, @p_localnamespacename)";

            var paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("p_synapsenamespaceid", this.hdnNamespaceID.Value),
                new KeyValuePair <string, string>("p_synapsenamespacename", SynapseHelpers.GetNamespaceNameFromID(this.hdnNamespaceID.Value)),
                new KeyValuePair <string, string>("p_entityname", this.ddlCoreEntity.SelectedItem.Text),
                new KeyValuePair <string, string>("p_entitydescription", this.txtEntityComments.Text),
                new KeyValuePair <string, string>("p_username", this.hdnUserName.Value),
                new KeyValuePair <string, string>("p_localnamespaceid", this.hdnLocalNamespaceID.Value),
                new KeyValuePair <string, string>("p_localnamespacename", SynapseHelpers.GetNamespaceNameFromID(this.hdnLocalNamespaceID.Value)),
            };

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

            string newGuid = "";

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

            Response.Redirect("EntityManagerAttributes.aspx?id=" + newGuid);
        }
Beispiel #7
0
        protected void btnCreateNewEntity_Click(object sender, EventArgs e)
        {
            string tmpViewName = Guid.NewGuid().ToString("N");
            //Check if we can create a temporary view using the supplied SQL Statement
            string sqlCreate       = "CREATE VIEW baseviewcore." + this.lblNamespaceName.Text + "_" + this.txtEntityName.Text + " AS " + this.txtSQL.Text + ";";
            var    paramListCreate = new List <KeyValuePair <string, string> >()
            {
            };

            try
            {
                DataServices.executeSQLStatement(sqlCreate, paramListCreate);
            }
            catch (Exception ex)
            {
                this.lblError.Text    = "Error creating view: " + ex.ToString();
                this.lblError.Visible = true;
                return;
            }

            string sql = "SELECT listsettings.createbaseview(@p_baseviewnamespaceid, @p_baseviewnamespace, @p_baseviewname, @p_baseviewdescription, @p_baseviewsqlstatement, @p_username);";

            var paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("p_baseviewnamespaceid", this.hdnNamespaceID.Value),
                new KeyValuePair <string, string>("p_baseviewnamespace", SynapseHelpers.GetBaseviewNamespaceNameFromID(this.hdnNamespaceID.Value)),
                new KeyValuePair <string, string>("p_baseviewname", this.txtEntityName.Text),
                new KeyValuePair <string, string>("p_baseviewdescription", this.txtEntityComments.Text),
                new KeyValuePair <string, string>("p_baseviewsqlstatement", this.txtSQL.Text),
                new KeyValuePair <string, string>("p_username", this.hdnUserName.Value)
            };


            DataSet ds = new DataSet();

            try
            {
                ds = DataServices.DataSetFromSQL(sql, paramList);
            }
            catch (Exception ex)
            {
                this.lblError.Text    = "Error creating view: " + System.Environment.NewLine + ex.ToString();
                this.lblError.Visible = true;
                return;
            }



            DataTable dt = ds.Tables[0];

            string newGuid = "";

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

            Response.Redirect("BaseviewManagerView.aspx?id=" + newGuid);
        }
Beispiel #8
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));
        }
Beispiel #9
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));
        }
        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;};");
            }
        }
Beispiel #11
0
        public Export createObjectFromExport(Stream stream)
        {
            StreamReader sr = new StreamReader(stream);
            Export       ex = SynapseHelpers.DeserialiseExport(sr.ReadToEnd());

            sr.Close(); sr.Dispose();
            return(ex);
        }
Beispiel #12
0
        public IActionResult BaseViewManagerNew(string id)
        {
            namespaceId = id;
            BaseViewModel model = new BaseViewModel();

            model.BaseviewNamespaceName = SynapseHelpers.GetBaseviewNamespaceNameFromID(namespaceId);
            return(View(model));
        }
        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.hdnListID.Value = id;

                try
                {
                }
                catch { }

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


                this.lblSummaryType.Text          = SynapseHelpers.GetListNameFromID(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;
                this.ltrlError.Visible  = false;

                this.btnShowDeleteBaseView.Visible = false;

                string uri = SynapseHelpers.GetEBoardURL() + "ListPreview.aspx?id=" + this.hdnListID.Value;

                this.hlPreview.NavigateUrl = uri;
                this.hlPreview.Target      = "_blank";


                BindFormFields();
            }
        }
Beispiel #14
0
        public Export createObjectFromExport(string filename)
        {
            StreamReader sr = new StreamReader("c:\\export\\" + filename);
            Export       ex = SynapseHelpers.DeserialiseExport(sr.ReadToEnd());

            sr.Close(); sr.Dispose();

            return(ex);
        }
        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.hdnListID.Value = id;

                try
                {
                }
                catch { }

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


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

                DataTable dtt = SynapseHelpers.GetListDT(id);
                try
                {
                    this.lblContextField.Text = dtt.Rows[0]["defaultcontextfield"].ToString();
                }
                catch { }

                try
                {
                    this.lblDefaultContext.Text = dtt.Rows[0]["defaultcontext"].ToString();
                }
                catch { }


                string uri = SynapseHelpers.GetEBoardURL() + "ListPreview.aspx?id=" + this.hdnListID.Value;

                this.hlPreview.NavigateUrl = uri;
                this.hlPreview.Target      = "_blank";
            }
        }
Beispiel #16
0
        private void CreateNewList()
        {
            string sql = "INSERT INTO listsettings.listmanager(list_id, listname, listdescription, listcontextkey, baseview_id, listnamespaceid, " +
                         "listnamespace, defaultcontext, defaultcontextfield, matchedcontextfield, tablecssstyle, tableheadercssstyle, defaultrowcssstyle, " +
                         "patientbannerfield, rowcssfield, wardpersonacontextfield, clinicalunitpersonacontextfield, specialtypersonacontextfield, teampersonacontextfield, snapshottemplateline1, " +
                         "snapshottemplateline2, snapshottemplatebadge, defaultsortcolumn, defaultsortorder) " +
                         "VALUES (@list_id, @listname, @listdescription, @listcontextkey, @baseview_id, @listnamespaceid, " +
                         "@listnamespace, @defaultcontext, @defaultcontextfield, @matchedcontextfield, @tablecssstyle, @tableheadercssstyle, @defaultrowcssstyle, @patientbannerfield, @rowcssfield, " +
                         "@wardpersonacontextfield, @clinicalunitpersonacontextfield, @specialtypersonacontextfield, @teampersonacontextfield, @snapshottemplateline1, @snapshottemplateline2, @snapshottemplatebadge, " +
                         "@defaultsortcolumn, @defaultsortorder)";

            string newId     = System.Guid.NewGuid().ToString();
            var    paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("list_id", newId),
                new KeyValuePair <string, string>("listname", this.txtListName.Text),
                new KeyValuePair <string, string>("listdescription", this.txtListComments.Text),
                new KeyValuePair <string, string>("listcontextkey", ""),
                new KeyValuePair <string, string>("baseview_id", this.ddlBaseView.SelectedValue),
                new KeyValuePair <string, string>("listnamespaceid", this.hdnNamespaceID.Value),
                new KeyValuePair <string, string>("listnamespace", SynapseHelpers.GetListNamespaceNameFromID(this.hdnNamespaceID.Value)),
                new KeyValuePair <string, string>("defaultcontext", this.ddlDefaultContext.SelectedValue),
                new KeyValuePair <string, string>("defaultcontextfield", this.lblDefaultContextField.Text),
                new KeyValuePair <string, string>("matchedcontextfield", this.ddlMatchedContextField.SelectedValue),
                new KeyValuePair <string, string>("patientbannerfield", this.ddlPatientBannerField.SelectedValue),
                new KeyValuePair <string, string>("rowcssfield", this.ddlRowCSSField.SelectedValue),
                new KeyValuePair <string, string>("tablecssstyle", this.txtTableClass.Text),
                new KeyValuePair <string, string>("tableheadercssstyle", this.txtTableHeaderClass.Text),
                new KeyValuePair <string, string>("defaultrowcssstyle", this.txtDefaultTableRowCSS.Text),
                new KeyValuePair <string, string>("wardpersonacontextfield", this.ddlWardPersonaContextField.SelectedValue == "0" ? null : this.ddlWardPersonaContextField.SelectedValue),
                new KeyValuePair <string, string>("clinicalunitpersonacontextfield", this.ddlCUPersonaContextField.SelectedValue == "0" ? null : this.ddlCUPersonaContextField.SelectedValue),
                new KeyValuePair <string, string>("specialtypersonacontextfield", this.ddlSpecialtyPersonaContextField.SelectedValue == "0" ? null : this.ddlSpecialtyPersonaContextField.SelectedValue),
                new KeyValuePair <string, string>("teampersonacontextfield", this.ddlTeamPersonaContextField.SelectedValue == "0" ? null : this.ddlTeamPersonaContextField.SelectedValue),
                new KeyValuePair <string, string>("snapshottemplateline1", this.ddlSnapshotLine1.SelectedValue == "0" ? null : this.ddlSnapshotLine1.SelectedValue),
                new KeyValuePair <string, string>("snapshottemplateline2", this.ddlSnapshotLine2.SelectedValue == "0" ? null : this.ddlSnapshotLine2.SelectedValue),
                new KeyValuePair <string, string>("snapshottemplatebadge", this.ddlSnapshotBadge.SelectedValue == "0" ? null : this.ddlSnapshotBadge.SelectedValue),
                new KeyValuePair <string, string>("defaultsortcolumn", this.ddlDefaultSortColumn.SelectedValue == "0" ? null : this.ddlDefaultSortColumn.SelectedValue),
                // Don't save defaultsortorder if defaultsortcolumn is not selected
                new KeyValuePair <string, string>("defaultsortorder", this.ddlDefaultSortColumn.SelectedValue == "0" ? null : this.ddlDefaultSortOrder.SelectedValue)
            };

            try
            {
                DataServices.ExcecuteNonQueryFromSQL(sql, paramList);
                updateTeminusFilter(newId);
            }
            catch (Exception ex)
            {
                this.lblError.Text    = ex.ToString();
                this.lblError.Visible = true;
                return;
            }


            Response.Redirect("ListManagerAttributes.aspx?id=" + newId);
        }
Beispiel #17
0
        public IActionResult BedBoardDeviceView(string id)
        {
            DataSet dsBedBoard = DataServices.DataSetFromSQL("SELECT bedboard_id, bedboardname FROM eboards.bedboard");

            ViewBag.BedBoard = ToSelectList(dsBedBoard.Tables[0], "bedboard_id", "bedboardname");

            DataSet dsWard = DataServices.DataSetFromSQL("SELECT wardcode, warddisplay FROM entitystorematerialised.meta_ward ORDER BY warddisplay");

            ViewBag.Ward = ToSelectList(dsWard.Tables[0], "wardcode", "warddisplay");

            string  sql       = "SELECT * FROM eboards.bedboarddevice WHERE bedboarddevice_id = @bedboarddevice_id;";
            DataSet ds        = new DataSet();
            var     paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("bedboarddevice_id", id)
            };

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

            model.DeviceId = id;
            try
            {
                model.DeviceName = dt.Rows[0]["bedboarddevicename"].ToString();
            }
            catch { }

            try
            {
                model.IPAddress = dt.Rows[0]["deviceipaddress"].ToString();
            }
            catch { }
            model.BedBoardId = dt.Rows[0]["bedboard_id"].ToString();
            model.WardId     = dt.Rows[0]["locationward"].ToString(); //dt.Rows[0]["bedboard_id"].ToString();

            DataSet dsBayRoom = DataServices.DataSetFromSQL("SELECT baycode, baydisplay FROM entitystorematerialised.meta_wardbay WHERE wardcode = '" +
                                                            dt.Rows[0]["locationward"].ToString() + "' ORDER BY baydisplay;");

            ViewBag.BayRoom = ToSelectList(dsBayRoom.Tables[0], "baycode", "baydisplay");

            model.BayRoomId = dt.Rows[0]["locationbayroom"].ToString();

            DataSet dsBed = DataServices.DataSetFromSQL("SELECT wardbaybed_id, beddisplay FROM entitystorematerialised.meta_wardbaybed WHERE " +
                                                        "wardcode = '" + dt.Rows[0]["locationward"].ToString() + "' AND baycode = '" + dt.Rows[0]["locationbayroom"].ToString() + "' ORDER BY beddisplay;");

            ViewBag.Bed = ToSelectList(dsBed.Tables[0], "wardbaybed_id", "beddisplay");

            model.BedId = dt.Rows[0]["locationbed"].ToString();

            string uri = SynapseHelpers.GetEBoardURL();

            ViewBag.BoardUrl = uri + "DynamicBedBoard.aspx";
            return(View(model));
        }
Beispiel #18
0
        protected void btnDropAttribute_Click(object sender, EventArgs e)
        {
            DataTable dtBVs = SynapseHelpers.GetEntityBaseviewsDT(this.hdnEntityID.Value);


            string sql = @"SELECT entitysettings.dropattributefromentity(
                                @p_attributeid,
	                            @p_entityid
                            )";



            var paramList = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("p_attributeid", this.hdnAttributeID.Value),
                new KeyValuePair <string, string>("p_entityid", this.hdnEntityID.Value)
            };

            try
            {
                DataServices.ExcecuteNonQueryFromSQL(sql, paramList);
            }
            catch (Exception ex)
            {
                this.lblError.Text    = ex.ToString();
                this.lblError.Visible = true;
                return;
            }


            foreach (DataRow row in dtBVs.Rows)
            {
                string baseview_id       = row["baseview_id"].ToString();
                string sqlRecreate       = "SELECT listsettings.recreatebaseview(@baseview_id);";
                var    paramListRecreate = new List <KeyValuePair <string, string> >()
                {
                    new KeyValuePair <string, string>("baseview_id", baseview_id)
                };

                try
                {
                    DataServices.ExcecuteNonQueryFromSQL(sqlRecreate, paramListRecreate);
                }
                catch (Exception ex)
                {
                    this.lblError.Text    = ex.ToString();
                    this.lblError.Visible = true;
                    return;
                }
            }


            Response.Redirect("EntityManagerAttributes.aspx?action=view&id=" + this.hdnEntityID.Value);
        }
Beispiel #19
0
        public Baseview getBaseViewByIdForExport(string baseviewid)
        {
            Baseview b           = new Baseview();
            DataSet  dtBVManager = SynapseHelpers.GetBaseviewManager(baseviewid);

            b.BaseviewManager = SynapseHelpers.SerializeDataSet(dtBVManager, SynapseHelpers.DataSetSerializerType.Json);
            b.Name            = dtBVManager.Tables[0].Rows[0]["baseviewname"].ToString();
            b.Id        = dtBVManager.Tables[0].Rows[0]["baseview_id"].ToString();
            b.Namespace = SynapseHelpers.SerializeDataSet(SynapseHelpers.GetBaseviewNamespace(baseviewid), SynapseHelpers.DataSetSerializerType.Json);

            return(b);
        }
Beispiel #20
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;};");
            }
        }
        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;
            }
        }
Beispiel #22
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;};");
            }
        }
Beispiel #24
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));
        }
Beispiel #25
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));
        }
Beispiel #26
0
        public IActionResult RelationView(string id)
        {
            ViewBag.Id         = namespaceId;
            ViewBag.RelationId = id;
            ViewBag.Summary    = SynapseHelpers.GetAttributeNameFromAttributeID(id);
            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 dsEntityDetail = DataServices.DataSetFromSQL(sql, paramList);

            List <DetailDto> detailDto = dsEntityDetail.Tables[0].ToList <DetailDto>();

            return(View(detailDto));
        }
Beispiel #27
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));
        }
Beispiel #28
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.hdnDeviceID.Value = id;

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

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

                BindDropDownList(this.ddlBedBoard, "SELECT bedboard_id, bedboardname FROM eboards.bedboard", "bedboard_id", "bedboardname", 0, paramList);
                BindDropDownList(this.ddllWard, "SELECT wardcode, warddisplay FROM entitystorematerialised.meta_ward ORDER BY warddisplay", "wardcode", "warddisplay", 0, paramList);
                BindFormControls();


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

                string uri = SynapseHelpers.GetEBoardURL();
                this.hlPreview.NavigateUrl = uri + "DynamicBedBoard.aspx";
                this.hlPreview.Target      = "_blank";
            }
        }
Beispiel #29
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));
        }
Beispiel #30
0
        public Entity getEntityByIdForExport(string entityid)
        {
            Entity e = new Entity();

            if (!string.IsNullOrEmpty(entityid))
            {
                e.Id = entityid;
                e.EntityAttributes = SynapseHelpers.SerializeDataSet(SynapseHelpers.GetEntityAttributes(entityid), SynapseHelpers.DataSetSerializerType.Json);
                DataSet dsEntityManager = SynapseHelpers.GetEntityManager(entityid);
                e.EntityManager   = SynapseHelpers.SerializeDataSet(dsEntityManager, SynapseHelpers.DataSetSerializerType.Json);
                e.EntityRelation  = SynapseHelpers.SerializeDataSet(SynapseHelpers.GetEntityRelation(entityid), SynapseHelpers.DataSetSerializerType.Json);
                e.Namespace       = SynapseHelpers.SerializeDataSet(SynapseHelpers.GetEntityNamespace(entityid), SynapseHelpers.DataSetSerializerType.Json);
                e.SystemNamespace = SynapseHelpers.SerializeDataSet(SynapseHelpers.GetEntitySystemNamespace(entityid), SynapseHelpers.DataSetSerializerType.Json);
                e.Name            = dsEntityManager.Tables[0].Rows[0]["entityname"].ToString();
            }

            return(e);
        }