Пример #1
0
        private void SetPageTitles(bool IsEFormApproved)
        {
            if (IsEFormApproved)
            {
                NavTitle.Text = "Print Narrative";

                string approvedBy   = "";
                string approvedTime = "";
                string userRealName = "";

                // get the user who approved form and date
                EFormsDa da = new EFormsDa();

                DataSet ds = da.GetEformsRecord(base.EFormId);

                if (ds.Tables[0].Rows.Count == 1)
                {
                    approvedBy   = ds.Tables[0].Rows[0][EForm.UpdatedBy].ToString();
                    approvedTime = ds.Tables[0].Rows[0][EForm.UpdatedTime].ToString();

                    UserDa  userda = new UserDa();
                    DataSet userds = userda.GetByUserName(approvedBy);

                    userRealName = userds.Tables[0].Rows[0]["UserFirstName"].ToString() + " " + userds.Tables[0].Rows[0]["UserLastName"].ToString();
                }

                if (Session[SessionKey.PtFirstName] != null && Session[SessionKey.PtFirstName].ToString().Length > 0)
                {
                    NavTitle.Text += " for " + Session[SessionKey.PtFirstName].ToString();
                }

                if (Session[SessionKey.PtLastName] != null && Session[SessionKey.PtLastName].ToString().Length > 0)
                {
                    NavTitle.Text += " " + Session[SessionKey.PtLastName].ToString();
                }

                UserMsg.Text = "<span class=\"EFormAlertMsg\">This eform has been APPROVED by " + userRealName + " on " + approvedTime + " and is no longer available for update.</span><br/><br/><br/><br/>To print the narrative use the button located on the bottom right of this page.";
            }
            else
            {
                NavTitle.Text = "Approve Narrative";

                if (Session[SessionKey.PtFirstName] != null && Session[SessionKey.PtFirstName].ToString().Length > 0)
                {
                    NavTitle.Text += " for " + Session[SessionKey.PtFirstName].ToString();
                }

                if (Session[SessionKey.PtLastName] != null && Session[SessionKey.PtLastName].ToString().Length > 0)
                {
                    NavTitle.Text += " " + Session[SessionKey.PtLastName].ToString();
                }

                UserMsg.Text = "If all data is accurate approve the eform using the button on the lower right. Once approved you will no longer be able to update the eform.<br><br>After approval, the narrative will remain available for printing.";
            }
        }
Пример #2
0
        override protected void Page_Load(object sender, System.EventArgs e)
        {
            base.Page_Load(sender, e);
            base.SetTitle(ComponentTitle);

            EFormsDa eDa = new EFormsDa();
            DataSet  eDs = eDa.GetEformsRecord(this._eformId);
            DataView eDv = new DataView(eDs.Tables[0]);

            if (eDv.Count > 0)
            {
                EformName.Text = eDv[0][EForm.EFormName].ToString();
            }
        }
Пример #3
0
        /// <summary>
        /// when eform has already been approved redirects user to the clinic list
        /// </summary>
        private void CheckEFormApproval()
        {
            EFormController ect = new EFormController();

            string status = ect.GetEFormStatus(_eformId);

            if (status.Equals(EformStatusManager.Status_Approved))
            {
                string approvedBy   = "";
                string approvedTime = "";
                string userRealName = "";

                // get the user who approved form and date
                EFormsDa da = new EFormsDa();

                DataSet ds = da.GetEformsRecord(_eformId);

                if (ds.Tables[0].Rows.Count == 1)
                {
                    approvedBy   = ds.Tables[0].Rows[0][EForm.UpdatedBy].ToString();
                    approvedTime = ds.Tables[0].Rows[0][EForm.UpdatedTime].ToString();

                    UserDa  userda = new UserDa();
                    DataSet userds = userda.GetByUserName(approvedBy);

                    userRealName = userds.Tables[0].Rows[0]["UserFirstName"].ToString() + " " + userds.Tables[0].Rows[0]["UserLastName"].ToString();
                }

                string jsScript = "<script language=javascript>alert('This eform was approved by " + userRealName + " on " + approvedTime + " and can no longer be updated.\\n\\n You will now be redirected to the clinic list'); top.location.href = 'Index.aspx?status=home';</script>";

                Response.Write(jsScript);
            }
            // submit parent frame with data
            else
            {
                // js script from parent page passes in url var when it should submit
                if (Request.QueryString["submitMe"] != null && Request.QueryString["submitMe"].ToString().ToLower().Equals("true"))
                {
                    //submitMe()
                    string jsScript = "<script language=javascript>parent.submitMe();</script>";

                    Response.Write(jsScript);
                }
            }
        }