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(); } }
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"; } }
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)); }
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"; } }
protected void Page_Load(object sender, EventArgs e) { string id = ""; try { id = Request.QueryString["id"].ToString(); } catch { Response.Redirect("Error.aspx"); } hdnBoardID.Value = id; if (!IsPostBack) { try { this.hdnUserName.Value = Session["userFullName"].ToString(); } catch { } this.ltrlError.Visible = false; this.lblSuccess.Visible = false; BindDropDownList(this.ddlBaseViewNamespace, "SELECT * FROM listsettings.baseviewnamespace ORDER BY baseviewnamespace", "baseviewnamespaceid", "baseviewnamespace", 0, null); BindDropDownList(this.ddlList, "SELECT * FROM listsettings.listmanager ORDER BY listname", "list_id", "listname", 1, null); BindDBFields(); //BindListBaseViewFields(); //BindBaseViewList(); //BindBaseViewFields(); this.btnCancel.Attributes.Add("onclick", "if(confirm('Are you sure that you want to cancel any changes?')){return true;} else {return false;};"); this.btnDelete.Attributes.Add("onclick", "if(confirm('Are you sure that you want to delete this board?')){return true;} else {return false;};"); string uri = SynapseHelpers.GetEBoardURL() + "locatorboard.aspx?id=" + this.hdnBoardID.Value + "&Location=XXXXX"; this.hlPreview.NavigateUrl = uri; } }
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; }
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); }
public IActionResult LocatorBoardManagerView(string id) { DataSet dsBaseview = DataServices.DataSetFromSQL("SELECT * FROM listsettings.baseviewnamespace ORDER BY baseviewnamespace"); ViewBag.BaseviewNamespace = ToSelectList(dsBaseview.Tables[0], "baseviewnamespaceid", "baseviewnamespace"); DataSet dsList = DataServices.DataSetFromSQL("SELECT * FROM listsettings.listmanager ORDER BY listname"); ViewBag.List = ToSelectList(dsList.Tables[0], "list_id", "listname"); string sql = "SELECT * FROM eboards.locatorboard WHERE locatorboard_id = @locatorboard_id;"; DataSet ds = new DataSet(); var paramList = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("locatorboard_id", id) }; ds = DataServices.DataSetFromSQL(sql, paramList); DataTable dt = ds.Tables[0]; LocatorBoardModel model = new LocatorBoardModel(); model.LocatorBoardId = id; try { model.LocatorBoardName = dt.Rows[0]["locatorboardname"].ToString(); } catch { } try { model.LocatorBoardDescription = dt.Rows[0]["locatorboarddescription"].ToString(); } catch { } model.BaseViewNamespaceId = dt.Rows[0]["locationbaseviewnamespace_id"].ToString(); model.ListId = dt.Rows[0]["list_id"].ToString(); model.ListLocationField = dt.Rows[0]["listlocationfield"].ToString(); model.BaseViewId = dt.Rows[0]["locationbaseview_id"].ToString(); model.LocationIDField = dt.Rows[0]["locationidfield"].ToString(); model.Heading = dt.Rows[0]["locationdisplayfield"].ToString(); model.TopLeftField = dt.Rows[0]["topleftfield"].ToString(); model.TopRightField = dt.Rows[0]["toprightfield"].ToString(); ViewBag.PreviewURL = SynapseHelpers.GetEBoardURL() + "locatorboard.aspx?id=" + id + "&Location=XXXXX"; string sqlBaseView = "SELECT * FROM listsettings.baseviewmanager WHERE baseviewnamespaceid = @id ORDER BY baseviewname;"; var paramListBaseView = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("id", model.BaseViewNamespaceId) }; DataSet dsBaseView = DataServices.DataSetFromSQL(sqlBaseView, paramListBaseView); ViewBag.BaseView = ToSelectList(dsBaseView.Tables[0], "baseview_id", "baseviewname"); string sqlAtt = "SELECT attributename FROM listsettings.baseviewattribute WHERE baseview_id = @id ORDER BY attributename;"; var paramListAtt = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("id", model.BaseViewId) }; DataSet dsAtt = DataServices.DataSetFromSQL(sqlAtt, paramListAtt); List <SelectListItem> list = new List <SelectListItem>(); ViewBag.AttributeList = ToSelectList(dsAtt.Tables[0], "attributename", "attributename"); return(View(model)); }