public string UpdatePatientTargetWeight_PWD(string Group, string TargetWeight)
    {
        string     strReturn = "";
        SqlCommand cmdUpdate = new SqlCommand();

        gClass.MakeStoreProcedureName(ref cmdUpdate, "sp_ConsultFU1_PatientWeightData_UpdatePatientTitle", true);

        cmdUpdate.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);
        cmdUpdate.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
        cmdUpdate.Parameters.Add("@PatientID", SqlDbType.Int).Value        = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
        cmdUpdate.Parameters.Add("@TargetWeight", SqlDbType.Decimal);
        cmdUpdate.Parameters.Add("@Group", SqlDbType.VarChar, 6).Value = Group;

        try { cmdUpdate.Parameters["@TargetWeight"].Value = Convert.ToDecimal(TargetWeight); }
        catch { cmdUpdate.Parameters["@TargetWeight"].Value = 0; }

        try
        {
            gClass.ExecuteDMLCommand(cmdUpdate);
            strReturn = string.Empty;
        }
        catch (Exception err)
        {
            gClass.AddErrorLogData(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Url.Host, Context.Request.Cookies["Logon_UserName"].Value, "Global Web Service", "UpdatePatientTargetWeight_PWD function", err.ToString());
        }
        return(strReturn);
    }
    /*this function is to load the patients list*/
    private void PreLoadPatientsList()
    {
        string strScript = "";

        try
        {
            LoadPatientsList();
            strScript = "HideDivMessage();";
        }
        catch (Exception err)
        {
            strScript = "HideDivMessage();document.getElementById('divErrorMessage').style.display = 'block';SetInnerText(document.getElementById('pErrorMessage'), 'Error in loading patients list...');";
            gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Patient List Form", "btnLoad_onlick function", err.ToString());
        }
        ScriptManager.RegisterStartupScript(up_PatientsList, btnLoad.GetType(), Guid.NewGuid().ToString(), strScript, true);
    }
    private void FetchVisitData()
    {
        SqlCommand cmdSelect = new SqlCommand();
        DataSet    dsTemp;

        gClass.MakeStoreProcedureName(ref cmdSelect, "sp_ConsultFU1_ProgressNotes_LoadVisitData", true);
        cmdSelect.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);
        cmdSelect.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Request.Cookies["UserPracticeCode"].Value);
        cmdSelect.Parameters.Add("@ConsultID", SqlDbType.Int).Value        = Convert.ToInt32(Request.QueryString["CID"]);
        try
        {
            dsTemp = gClass.FetchData(cmdSelect, "tblVisitData");
            if (dsTemp.Tables.Count > 0)
            {
                AddTempFields(ref dsTemp);
            }

            Response.Write(dsTemp.GetXml());
        }
        catch (Exception err)
        {
            Response.Write("-1");
            gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value,
                                   "Visit Ajax Form", "FetchVisitData function", err.ToString());
        }
        cmdSelect.Dispose();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         gClass.OrganizationCode = Request.Cookies["OrganizationCode"].Value;
         if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
         {
             if (!IsPostBack)
             {
                 FetchDoctorList();
             }
         }
     }
     catch (Exception err)
     {
         string strLanguageCode;
         try
         {
             strLanguageCode = Request.Cookies["LanguageCode"].Value;
             gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Doctor User Control", "", err.ToString());
         }
         catch { strLanguageCode = "en-US"; }
         gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;

        try
        {
            Page.Culture            = Request.Cookies["CultureInfo"].Value;
            gClass.LanguageCode     = Request.Cookies["LanguageCode"].Value;
            gClass.OrganizationCode = Request.Cookies["OrganizationCode"].Value;
            bodyComorbidity.Attributes.Add("onload", "javascript:LoadPatientComplicationHistoryData();");
            txtHApplicationURL.Value = Request.Url.Scheme + "://" + Request.Url.Host + Request.ApplicationPath + "/";
            bodyComorbidity.Attributes.Add("onload", "javascript:InitialPage();");

            if (!gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response);
                return;
            }
        }
        catch (Exception err)
        {
            string strLanguageCode;
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Visit Comorbidity Form", "Page_Load function", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
    }
    public XmlDocument SaveDocumentDetail(string strDocumentID, string strDocumentName, string strDoc_Description)
    {
        SqlCommand cmdUpdate = new SqlCommand();
        string     strResult = "";

        gClass.MakeStoreProcedureName(ref cmdUpdate, "sp_FileManagement_UpdateDocumentDetail", true);
        try
        {
            cmdUpdate.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value          = Convert.ToInt32(gClass.OrganizationCode);
            cmdUpdate.Parameters.Add("@tblPatientDocumentsID", SqlDbType.Int).Value     = Convert.ToInt32(strDocumentID);
            cmdUpdate.Parameters.Add("@DocumentName", SqlDbType.VarChar, 50).Value      = strDocumentName;
            cmdUpdate.Parameters.Add("@Doc_Description", SqlDbType.VarChar, 1024).Value = strDoc_Description;

            gClass.ExecuteDMLCommand(cmdUpdate);
            strResult = "0";

            gClass.SaveActionLog(gClass.OrganizationCode,
                                 Context.Request.Cookies["UserPracticeCode"].Value,
                                 Context.Request.Url.Host,
                                 System.Configuration.ConfigurationManager.AppSettings["DocumentPage"].ToString(),
                                 System.Configuration.ConfigurationManager.AppSettings["LogUpdate"].ToString(),
                                 "Save " + System.Configuration.ConfigurationManager.AppSettings["DocumentPage"].ToString() + " Data Detail",
                                 Context.Request.Cookies["PatientID"].Value,
                                 strDocumentID);
        }
        catch (Exception err)
        {
            gClass.AddErrorLogData(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Url.Host, Context.Request.Cookies["Logon_UserName"].Value, "File Management Form", "Update File data (SaveDocumentDetail)", err.ToString());
            strResult = "-1";
        }
        return(gClass.GetXmlDocument(Guid.NewGuid(), strResult));
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Response.CacheControl = "no-cache";
         Response.AddHeader("Pragma", "no-cache");
         Response.Expires = -1;
         Page.Culture     = Request.Cookies["CultureInfo"].Value;
         if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
         {
             gClass.LanguageCode = Request.Cookies["LanguageCode"].Value;
         }
         else
         {
             gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response);
         }
     }
     catch (Exception err)
     {
         string strLanguageCode;
         try
         {
             strLanguageCode = Request.Cookies["LanguageCode"].Value;
             gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Referring Doctor Form", "Loading Patient List (Page_Load function)", err.ToString());
         }
         catch { strLanguageCode = "en-US"; }
         gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
     }
 }
예제 #8
0
    private Dictionary <string, string> buildCodeDictionary(string categoryCode, string type)
    {
        SqlCommand cmdSelect = new SqlCommand();
        DataSet    dsCode    = new DataSet();
        Dictionary <string, string> tempCodeDesc = new Dictionary <string, string>();

        try
        {
            gClass.MakeStoreProcedureName(ref cmdSelect, "sp_Codes_LoadAllData", true);
            cmdSelect.Parameters.Add("@CategoryCode", SqlDbType.VarChar).Value = categoryCode;
            dsCode = gClass.FetchData(cmdSelect, "tblCodes");

            for (int Xh = 0; Xh < dsCode.Tables[0].Rows.Count; Xh++)
            {
                if (type == "rank")
                {
                    tempCodeDesc.Add(dsCode.Tables[0].Rows[Xh]["Code"].ToString(), dsCode.Tables[0].Rows[Xh]["Rank"].ToString());
                }
                else
                {
                    tempCodeDesc.Add(dsCode.Tables[0].Rows[Xh]["Code"].ToString(), dsCode.Tables[0].Rows[Xh]["Description"].ToString());
                }
            }
        }
        catch (Exception err)
        {
            gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Load Code Description", "Load Code Description", err.ToString());
        }

        return(tempCodeDesc);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;


        try
        {
            strMDBFileName = "MyLapbase" + Request.Cookies["UserPracticeCode"].Value + ".MDB";
            strMDBPath     = Server.MapPath(".") + "/MDB/" + strMDBFileName;
            strLDBFileName = "MyLapbase" + Request.Cookies["UserPracticeCode"].Value + ".LDB";
            strLDBPath     = Server.MapPath(".") + "/MDB/" + strLDBFileName;

            Page.Culture            = Request.Cookies["CultureInfo"].Value;
            gClass.LanguageCode     = Request.Cookies["LanguageCode"].Value;
            gClass.OrganizationCode = Request.Cookies["OrganizationCode"].Value;
            if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                if (!IsPostBack)
                {
                    gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value,
                                           Request.Cookies["Logon_UserName"].Value,
                                           Request.Url.Host,
                                           "Import/Export Data Form", 2, "Browse", "", "");
                    bodyImportExportData.Style.Add("Direction", Request.Cookies["Direction"].Value);
                    CheckQueryString();
                }
            }
            else
            {
                gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response);
            }
        }
        catch (Exception err)
        {
            string strLanguageCode;
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Import/Export data form", "Loading Patient List (Page_Load function)", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
        return;
    }
예제 #10
0
    public void LoadFieldNames(string strCulture, string strFormID, bool LogonFormFlag)
    {
        try
        {
            string strLanguageCode = "", strDirection = "";

            if (LogonFormFlag)
            {
                SetLanguageInfo(strCulture);
                strLanguageCode = Response.Cookies["LanguageCode"].Value;
                strDirection    = Response.Cookies["Direction"].Value;
            }
            else
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                strDirection    = Request.Cookies["Direction"].Value;
            }

            gClass.LanguageCode = strLanguageCode;// Response.Cookies["LanguageCode"].Value; //Application["LanguageCode"].ToString();
            gClass.FetchCaptions(strFormID, strLanguageCode);

            if (gClass.dsSchemaFields.Tables.Count > 0)
            {
                System.Data.DataColumn dtCol = new System.Data.DataColumn();

                dtCol.ColumnName   = "strLanguage";
                dtCol.Caption      = "strLanguage";
                dtCol.DataType     = Type.GetType("System.String");
                dtCol.DefaultValue = strLanguageCode;// Response.Cookies["LanguageCode"].Value.Substring(0, 2);
                gClass.dsSchemaFields.Tables[0].Columns.Add(dtCol);

                dtCol              = new System.Data.DataColumn();
                dtCol.ColumnName   = "strDirection";
                dtCol.Caption      = "strDirection";
                dtCol.DataType     = Type.GetType("System.String");
                dtCol.DefaultValue = strDirection;// Response.Cookies["Direction"].Value;

                gClass.dsSchemaFields.Tables[0].Columns.Add(dtCol);
                gClass.dsSchemaFields.AcceptChanges();
            }

            if (LogonFormFlag)
            {
                Response.Write(gClass.dsSchemaFields.GetXml());
            }
            else
            {
                Response.Write(gClass.dsSchemaFields.GetXml());
            }
        }
        catch (Exception err)
        {
            Response.Write(err.ToString());
            gClass.AddErrorLogData("0", Request.Url.Host, "", "Global.aspx - Load captions and titles", "LoadFieldNames function", err.ToString());
        }
        return;
    }
예제 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;

        string strScript = String.Empty;

        try
        {
            Page.Culture            = Request.Cookies["CultureInfo"].Value;
            gClass.LanguageCode     = Request.Cookies["LanguageCode"].Value;
            gClass.OrganizationCode = Request.Cookies["OrganizationCode"].Value;
            if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                if (!IsPostBack)
                {
                    gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value,
                                           Request.Cookies["Logon_UserName"].Value,
                                           Request.Url.Host,
                                           "Import File Form", 2, "Browse", "", "");
                }
            }
            else
            {
                gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response);
            }
        }
        catch (Exception err)
        {
            string strLanguageCode;
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Import/Export data form", "Loading Patient List (Page_Load function)", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
        return;
    }
예제 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;

        try
        {
            Page.Culture             = Request.Cookies["CultureInfo"].Value;
            gClass.LanguageCode      = Request.Cookies["LanguageCode"].Value;
            gClass.OrganizationCode  = Request.Cookies["OrganizationCode"].Value;
            txtHApplicationURL.Value = Request.Url.Scheme + "://" + Request.Url.Host + Request.ApplicationPath + "/";
            bodyImportExport.Style.Add("Direction", Request.Cookies["Direction"].Value);
            if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                if (!IsPostBack)
                {
                    //Do not display SelectedFilesCount progress indicator.
                    RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount;

                    RadProgressArea1.Localization["UploadedFiles"]   = "Processed ";
                    RadProgressArea1.Localization["TotalFiles"]      = "";
                    RadProgressArea1.Localization["CurrentFileName"] = "File: ";

                    RadProgressContext progress = RadProgressContext.Current;
                    //Prevent the secondary progress from appearing when the file is uploaded (FileCount etc.)
                    progress["SecondaryTotal"]   = "0";
                    progress["SecondaryValue"]   = "0";
                    progress["SecondaryPercent"] = "0";

                    gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value,
                                           Request.Cookies["Logon_UserName"].Value,
                                           Request.Url.Host,
                                           "Import/Export Data Form", 2, "Browse", "", "");
                }
            }
            else
            {
                gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response);
            }
        }
        catch (Exception err)
        {
            string strLanguageCode;
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Import/Export Page (Second stage)", " (Page_Load function)", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
    }
    private void LoadPatientOperations()
    {
        SqlCommand cmdSelect = new SqlCommand();
        string     strReturn = "";

        gClass.MakeStoreProcedureName(ref cmdSelect, "sp_Operation_SelectPatientOperationsList", true);
        cmdSelect.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);
        cmdSelect.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Request.Cookies["UserPracticeCode"].Value);
        cmdSelect.Parameters.Add("@PatientID", SqlDbType.Int).Value        = Convert.ToInt32(Request.Cookies["PatientID"].Value);
        cmdSelect.Parameters.Add("@ImperialFlag", SqlDbType.Bit).Value     = Request.Cookies["Imperial"].Value.Equals("True");

        try
        {
            DataSet    dsTemp    = gClass.FetchData(cmdSelect, "tblPatientOperation");
            DataColumn dcStrDate = new DataColumn();

            dcStrDate.ColumnName = "strDateOperation";
            dcStrDate.DataType   = Type.GetType("System.String");
            dsTemp.Tables[0].Columns.Add(dcStrDate);
            for (int Xh = 0; Xh < dsTemp.Tables[0].Rows.Count; Xh++)
            {
                dsTemp.Tables[0].Rows[Xh]["strDateOperation"] = gClass.TruncateDate(dsTemp.Tables[0].Rows[Xh]["OperationDate"].ToString(), Request.Cookies["CultureInfo"].Value, 1);
            }
            dsTemp.AcceptChanges();
            strReturn = gClass.ShowSchema(dsTemp, Server.MapPath(".") + @"\OperationsListXSLTFile.xsl");
        }
        catch (Exception err)
        {
            strReturn = err.ToString();

            gClass.AddErrorLogData(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Url.Host,
                                   Context.Request.Cookies["Logon_UserName"].Value, "Operation form (Ajax form)",
                                   "Load Patient's Operation List - LoadPatientOperations function", err.ToString());
        }
        Response.Write(strReturn);
        return;
    }
예제 #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;

        string strScript = String.Empty;

        try
        {
            Page.Culture            = Request.Cookies["CultureInfo"].Value;
            gClass.LanguageCode     = Request.Cookies["LanguageCode"].Value;
            gClass.OrganizationCode = Request.Cookies["OrganizationCode"].Value;
            if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                if (!IsPostBack)
                {
                    gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value,
                                           Request.Cookies["Logon_UserName"].Value,
                                           Request.Url.Host,
                                           "Import File Form", 2, "Browse", "", "");
                    LoadLabHistory();
                }
            }
            else
            {
                gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response);
            }
        }
        catch (Exception err)
        {
            string strLanguageCode;
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Import/Export data form", "Loading Patient List (Page_Load function)", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
        if (Request.QueryString.Count > 0)
        {
            if (Request.QueryString["PatID"] != null)
            {
                if (txtHLabID.Value == "0" && Request.QueryString["PatID"].ToString() != "")
                {
                    LoadLabData(Request.QueryString["PatID"].ToString());
                }
            }
            if (Request.QueryString["Rev"] != null)
            {
                strScript = "javascript:ShowLabFormDiv(1);controlBar_Buttons_OnClick(2);document.getElementById('pathologyResultTable').innerHTML = '';";
                ScriptManager.RegisterStartupScript(btnDeleteLab, btnDeleteLab.GetType(), Guid.NewGuid().ToString(), strScript, true);
            }
        }
        return;
    }
예제 #15
0
    //------------------------------------------------------------------------------------------------------------
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;

        try
        {
            gClass.OrganizationCode  = Request.Cookies["OrganizationCode"].Value;
            txtHCulture.Value        = Request.Cookies["CultureInfo"].Value;
            txtHApplicationURL.Value = Request.Url.Scheme + "://" + Request.Url.Host + "/";
            if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                if (!IsPostBack)
                {
                    FetchIEWLData();
                    if (dataExist == true)
                    {
                        SetChartConfig();

                        if (nextVisitExist == true)
                        {
                            SetChartConfigNext();
                        }
                        else
                        {
                            lblNextVisit.Style["display"]  = "none";
                            chartIEWLNext.Style["display"] = "none";
                        }
                    }
                }
            }
            else
            {
                gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response);
            }
        }
        catch (Exception err)
        {
            string strLanguageCode;
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "IEWL Graph", "Loading Files Data (Page_Load function)", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
    }
예제 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        txtHApplicationURL.Value = Request.Url.Scheme + "://" + Request.Url.Host + Request.ApplicationPath + "/";

        if (!IsPostBack)
        {
            try
            {
                InitializePage();
                GetChangeLog();
            }
            catch (Exception err)
            {
                divErrorMessage.Style["display"] = "block";
                divErrorMessage.InnerText        = "Lapbase is currently down for maintenance...";
                gClass.AddErrorLogData("0", Request.Url.Host, "", "login Form", "Page_Load function", err.ToString());
            }
        }
        else
        {
            Response.Cookies.Set(new HttpCookie("LanguageCode", cmbLanguage.SelectedValue));
        }
        return;
    }
    public XmlDocument SaveHospitalProc(string strHospitalID_OldValue, string strHospitalID, string strHospitalName, string strHospitalBoldCode, string strRegionId)
    {
        string     strResult = "";
        SqlCommand cmdSave   = new SqlCommand();

        gClass.MakeStoreProcedureName(ref cmdSave, "sp_Hospitals_SaveData", true);
        cmdSave.Parameters.Add("@HospitalId_OldValue", SqlDbType.VarChar, 6).Value = strHospitalID_OldValue;
        cmdSave.Parameters.Add("@HospitalId", SqlDbType.VarChar, 6).Value          = strHospitalID;
        cmdSave.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value           = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
        cmdSave.Parameters.Add("@HospitalName", SqlDbType.VarChar, 50).Value       = strHospitalName.Replace("'", "`");
        cmdSave.Parameters.Add("@HospitalBoldCode", SqlDbType.VarChar, 20).Value   = strHospitalBoldCode.Replace("'", "`");
        cmdSave.Parameters.Add("@RegionId", SqlDbType.VarChar, 6).Value            = strRegionId;
        cmdSave.Parameters.Add("@Street", SqlDbType.VarChar, 30).Value             = "";
        cmdSave.Parameters.Add("@Suburb", SqlDbType.VarChar, 20).Value             = "";
        cmdSave.Parameters.Add("@PostCode", SqlDbType.VarChar, 4).Value            = "";
        cmdSave.Parameters.Add("@Phone", SqlDbType.VarChar, 12).Value    = "";
        cmdSave.Parameters.Add("@Fax", SqlDbType.VarChar, 12).Value      = "";
        cmdSave.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);

        try
        {
            gClass.ExecuteDMLCommand(cmdSave);
            gClass.SaveUserLogFile(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Cookies["Logon_UserName"].Value,
                                   Context.Request.Url.Host, "MenuSetup Form", 2, "Save Hospital data - " + (strHospitalID.Equals(String.Empty) ? "Insert" : "Update"),
                                   "Hospital ID and Name", strHospitalID + ", " + strHospitalName);
            strResult = "0";
        }
        catch (Exception err)
        {
            strResult = err.ToString();
            gClass.AddErrorLogData(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Url.Host,
                                   Context.Request.Cookies["Logon_UserName"].Value, "MenuSetup Form", "Save Hospital data - SaveHospitalProc function", err.ToString());
        }

        return(gClass.GetXmlDocument(Guid.NewGuid(), strResult));
    }
예제 #18
0
 //-------------------------------------------------------------------------------------------------------------
 protected void Page_Load(object sender, EventArgs e)
 {
     intUserPracticeCode = Convert.ToInt32(Request.Cookies["UserPracticeCode"].Value);
     if (!IsPostBack)
     {
         try
         {
             FetchSystemCodeListData();
         }
         catch (Exception err)
         {
             gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value,
                                    "System Code Web User Control", "FetchSystemCodeListData function", err.ToString());
         }
     }
 }
예제 #19
0
    private void UploadFileProc()
    {
        try
        {
            string strFilePath = GetFilePath(uploadDocFile.PostedFile.FileName, Convert.ToByte(txtHFileType.Value));

            if (System.IO.File.Exists(strFilePath))
            {
                System.IO.File.Delete(strFilePath);
            }
            strDocumentName = uploadDocFile.PostedFile.FileName;

            uploadDocFile.PostedFile.SaveAs(strFilePath);
            if (IsMovieFile(System.IO.Path.GetExtension(uploadDocFile.PostedFile.FileName)))     // the type of document is VIDEO
            {
                Convert2FLVfile(strFilePath);
            }
            else
            {
                GetFileSize(strFilePath);
                GetFileBinaryData(strFilePath);
                strDocumentName  = System.IO.Path.GetFileNameWithoutExtension(uploadDocFile.PostedFile.FileName);
                strDocumentName += System.IO.Path.GetExtension(uploadDocFile.PostedFile.FileName);
            }
            SaveVisitDocumentData(strDocumentName, Convert.ToByte(txtHFileType.Value), txtDocLabel.Text.Trim(), txtDescription.Text.Trim());

            gClass.AddDocumentEventLog(intOrganizationCode.ToString(), Convert.ToInt32(txtHDocumentID.Value), 1, intUserPracticeCode, Request.Url.Host, "Upload file");
            listEventName.SelectedIndex = 0;     // Set the eventname to baseline after saving
            txtHUploadResult.Value      = "1";
        }
        catch (Exception err)
        {
            txtTest.Value += err.ToString();
            gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Upload Document Form", "Upload document", err.ToString());
            txtHUploadResult.Value = "2";
        }
        Response.Clear();
        return;
    }
예제 #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;
        try
        {
            gClass.LanguageCode     = Request.Cookies["LanguageCode"].Value;
            gClass.OrganizationCode = Request.Cookies["OrganizationCode"].Value;
            txtHCulture.Value       = Request.Cookies["CultureInfo"].Value;
            if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                RegisterClientScriptBlock();
                if (!IsPostBack)
                {
                    gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value,
                                           Request.Cookies["Logon_UserName"].Value,
                                           Request.Url.Host,
                                           "Complication Form", 2, "Browse", "PatientCode",
                                           Request.Cookies["PatientID"].Value);

                    gClass.SaveActionLog(gClass.OrganizationCode,
                                         Request.Cookies["UserPracticeCode"].Value,
                                         Request.Url.Host,
                                         System.Configuration.ConfigurationManager.AppSettings["ComplicationPage"].ToString(),
                                         System.Configuration.ConfigurationManager.AppSettings["LogRead"].ToString(),
                                         "Load " + System.Configuration.ConfigurationManager.AppSettings["ComplicationPage"].ToString() + " List ",
                                         Request.Cookies["PatientID"].Value,
                                         "");

                    txtHPermissionLevel.Value = Request.Cookies["PermissionLevel"].Value;
                    txtHDataClamp.Value       = Request.Cookies["DataClamp"].Value;


                    if (Request.Cookies["SubmitData"].Value.IndexOf("submitbold") >= 0 || Request.Cookies["PermissionLevel"].Value == "1o" || Request.Cookies["PermissionLevel"].Value == "2t" || Request.Cookies["PermissionLevel"].Value == "3f" || Request.Cookies["PermissionLevel"].Value == "4s")
                    {
                        divBtnDelete.Style["display"] = "none";
                    }

                    if (Request.Cookies["PermissionLevel"].Value == "1o")
                    {
                        btnColl.Style["display"] = "none";
                    }

                    lblNotes_com.Text = "Notes/Treatment";
                    if (Request.Cookies["SubmitData"].Value.IndexOf("acs") < 0)
                    {
                        lblNotes_com.Text               = "Notes";
                        tblPostopACS.Style["display"]   = "none";
                        trAdmissionACS.Style["display"] = "none";
                        trDischargeACS.Style["display"] = "none";
                        trPerformACS.Style["display"]   = "none";
                        trReasonACS.Style["display"]    = "none";
                    }

                    if (Request.Cookies["SubmitData"].Value.IndexOf("bold") >= 0)
                    {
                        LoadBoldList();
                    }
                }
            }
            else
            {
                gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response); return;
            }
        }
        catch (Exception err)
        {
            string strLanguageCode;
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Complication Form", "Loading Complication List (Page_Load function)", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
        CheckRequestQueryString();
        return;
    }
예제 #21
0
    private Boolean UpdatePatientData_DemoGraphics(String dbpatientID, DataRow drPatient, ArrayList newPatientDetail)
    {
        DateTimeFormatInfo dtInfo = new DateTimeFormatInfo();

        dtInfo.ShortDatePattern = @"dd/MM/yyyy";


        GlobalClass gClass  = new GlobalClass();
        SqlCommand  cmdSave = new SqlCommand();

        String newPatientID        = newPatientDetail[0].ToString();
        String newPatientTitle     = newPatientDetail[1].ToString();
        String newPatientSurname   = newPatientDetail[2].ToString();
        String newPatientFirstname = newPatientDetail[3].ToString();
        String newPatientAddress   = newPatientDetail[4].ToString();
        String newPatientSuburb    = newPatientDetail[5].ToString();
        String newPatientPostcode  = newPatientDetail[6].ToString();
        String newPatientDOB       = newPatientDetail[7].ToString();
        String newPatientHomePhone = newPatientDetail[8].ToString();
        String newPatientWorkPhone = newPatientDetail[9].ToString();
        String newPatientGender    = newPatientDetail[10].ToString();

        String strNameId = String.Empty;

        strNameId  = (newPatientSurname.Length == 0) ? String.Empty : ((newPatientSurname.Length > 3) ? newPatientSurname.Substring(0, 4) : newPatientSurname);
        strNameId += (newPatientFirstname.Length == 0) ? String.Empty : newPatientFirstname.Substring(0, 1);

        if (strNameId.Equals(String.Empty))
        {
            //fail to insert-- need to return something
            return(false);
        }

        if (dbpatientID == "0")
        {
            gClass.MakeStoreProcedureName(ref cmdSave, "sp_PatientData_cmdInsert", true);
        }
        else
        {
            gClass.MakeStoreProcedureName(ref cmdSave, "sp_PatientData_cmdUpdate", true);
        }

        cmdSave.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value = Convert.ToInt32(34);
        cmdSave.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(87);

        cmdSave.Parameters.Add("@Patient_MDId", SqlDbType.VarChar, 7).Value = newPatientID;
        cmdSave.Parameters.Add("@NameId", SqlDbType.VarChar, 7).Value       = strNameId;
        cmdSave.Parameters.Add("@Surname", SqlDbType.VarChar, 40).Value     = newPatientSurname.Replace("'", "`");
        cmdSave.Parameters.Add("@Firstname", SqlDbType.VarChar, 30).Value   = newPatientFirstname.Replace("'", "`");
        cmdSave.Parameters.Add("@Title", SqlDbType.SmallInt).Value          = Convert.ToInt32(1);
        cmdSave.Parameters.Add("@Street", SqlDbType.VarChar, 40).Value      = newPatientAddress;
        cmdSave.Parameters.Add("@Suburb", SqlDbType.VarChar, 40).Value      = newPatientSuburb;
        cmdSave.Parameters.Add("@State", SqlDbType.VarChar, 10).Value       = "";
        cmdSave.Parameters.Add("@Postcode", SqlDbType.VarChar, 10).Value    = newPatientPostcode;
        cmdSave.Parameters.Add("@HomePhone", SqlDbType.VarChar, 30).Value   = newPatientHomePhone;
        cmdSave.Parameters.Add("@WorkPhone", SqlDbType.VarChar, 30).Value   = newPatientWorkPhone;
        cmdSave.Parameters.Add("@Race", SqlDbType.VarChar, 3).Value         = "";
        cmdSave.Parameters.Add("@Birthdate", SqlDbType.DateTime);

        if (newPatientDOB.Trim() == String.Empty)
        {
            cmdSave.Parameters["@Birthdate"].Value = DBNull.Value;
        }
        else
        {
            try
            {
                if (Convert.ToDateTime(newPatientDOB, dtInfo) < DateTime.Now)
                {
                    cmdSave.Parameters["@Birthdate"].Value = Convert.ToDateTime(newPatientDOB, dtInfo);
                }
                else
                {
                    cmdSave.Parameters["@Birthdate"].Value = DBNull.Value;
                }
            }
            catch { cmdSave.Parameters["@Birthdate"].Value = DBNull.Value; }
        }

        cmdSave.Parameters.Add("@Sex", SqlDbType.VarChar, 1).Value       = newPatientGender;
        cmdSave.Parameters.Add("@DoctorId", SqlDbType.Int).Value         = Convert.ToInt32(1);
        cmdSave.Parameters.Add("@RefDrId1", SqlDbType.VarChar, 10).Value = "";
        cmdSave.Parameters.Add("@RefDrId2", SqlDbType.VarChar, 10).Value = "";
        cmdSave.Parameters.Add("@RefDrId3", SqlDbType.VarChar, 10).Value = "";

        cmdSave.Parameters.Add("@MobilePhone", SqlDbType.VarChar, 30).Value      = "";
        cmdSave.Parameters.Add("@EmailAddress", SqlDbType.VarChar, 100).Value    = "";
        cmdSave.Parameters.Add("@Insurance", SqlDbType.VarChar, 50).Value        = "";
        cmdSave.Parameters.Add("@Patient_CustomID", SqlDbType.VarChar, 20).Value = "";

        gClass.AddLogParameters(ref cmdSave, Request.Cookies["Logon_UserName"].Value, Request.Url.Host, (dbpatientID.Equals("0")) ? "insert" : "update");

        try
        {
            if (dbpatientID.Equals("0")) // means new Patient Data, data must be inserted
            {
                gClass.SavePatientData(1, cmdSave);
                //Context.Response.SetCookie(new HttpCookie("PatientID", dbpatientID));
                //gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value, Request.Cookies["Logon_UserName"].Value, Request.Url.Host,
                //                        "Baseline Form", 2, "Add Data", "PatientCode", Response.Cookies["PatientID"].Value);
            }
            else //data must be Updated
            {
                cmdSave.Parameters.Add("@PatientId", SqlDbType.Int).Value = Convert.ToInt64(dbpatientID);

                gClass.SavePatientData(2, cmdSave);
                //Context.Response.SetCookie(new HttpCookie("PatientID", dbpatientID));
                //gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value, Request.Cookies["Logon_UserName"].Value,
                //                        Request.Url.Host, "Baseline Form", 2, "Modify Data", "PatientCode", dbpatientID);
            }
            //success
            //IsDoneSaveFlag = 1;
        }
        catch (Exception err)
        {
            gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Baseline", "Data saving baseline", err.ToString());
            //IsDoneSaveFlag = 0;
        }
        cmdSave.Dispose();

        return(true);
    }
    public XmlDocument SaveOperationProc(
        int PageNo, string AdmitID, string SurgeonId, string OperationDate, string Duration, string SurgeryType,
        string Approach, string Category, string Group, string BloodLoss, string Banded, string TubeSize,
        string BPDIlealLength, string VBGStomaWrap, string RouxLimbLength, string BPDChannelLength,
        string VBGStomaSize, string RouxEnterostomy, string ReservoirSite, string BPDDuodenalSwitch,
        string RouxColic, string BalloonVolume, string BPDStomachSize, string BandSize, string RouxGastric,
        string Pathway, string GeneralNotes, string HospitalCode, string DaysInHospital, string OpWeight,
        string chkUpdateWeight, string StartWeight, string Imperial)
    {
        string strReturn = "";

        System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(Context.Request.Cookies["CultureInfo"].Value, true);
        SqlCommand cmdOperation = new SqlCommand();

        AddOleCommandParameters(gClass, AdmitID, ref cmdOperation);
        try
        {
            cmdOperation.Parameters["@PageNo"].Value           = Convert.ToInt32(PageNo);
            cmdOperation.Parameters["@OrganizationCode"].Value = Convert.ToInt32(gClass.OrganizationCode);
            cmdOperation.Parameters["@UserPracticeCode"].Value = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
            cmdOperation.Parameters["@PatientId"].Value        = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
            cmdOperation.Parameters["@SurgeonId"].Value        = Convert.ToInt32(SurgeonId);
            cmdOperation.Parameters["@HospitalCode"].Value     = HospitalCode;
            try{ cmdOperation.Parameters["@OperationDate"].Value = Convert.ToDateTime(OperationDate); }
            catch { cmdOperation.Parameters["@OperationDate"].Value = DBNull.Value; }

            try { cmdOperation.Parameters["@Duration"].Value = Convert.ToInt32(Duration); }
            catch { cmdOperation.Parameters["@Duration"].Value = 0; }
            cmdOperation.Parameters["@SurgeryType"].Value = SurgeryType;
            cmdOperation.Parameters["@Approach"].Value    = Approach;
            cmdOperation.Parameters["@Category"].Value    = Category;
            cmdOperation.Parameters["@Group"].Value       = Group;
            cmdOperation.Parameters["@BloodLoss"].Value   = 0;// Convert.ToDouble(BloodLoss);
            cmdOperation.Parameters["@Banded"].Value      = Banded;

            cmdOperation.Parameters["@TubeSize"].Value          = TubeSize;
            cmdOperation.Parameters["@BPDIlealLength"].Value    = BPDIlealLength;
            cmdOperation.Parameters["@VBGStomaWrap"].Value      = VBGStomaWrap;
            cmdOperation.Parameters["@RouxLimbLength"].Value    = RouxLimbLength;
            cmdOperation.Parameters["@BPDChannelLength"].Value  = BPDChannelLength;
            cmdOperation.Parameters["@VBGStomaSize"].Value      = VBGStomaSize;
            cmdOperation.Parameters["@RouxEnterostomy"].Value   = RouxEnterostomy;
            cmdOperation.Parameters["@ReservoirSite"].Value     = ReservoirSite;
            cmdOperation.Parameters["@BPDDuodenalSwitch"].Value = (BPDDuodenalSwitch == "true");
            cmdOperation.Parameters["@RouxColic"].Value         = RouxColic;
            try { cmdOperation.Parameters["@BalloonVolume"].Value = Convert.ToDecimal(BalloonVolume); }
            catch { cmdOperation.Parameters["@BalloonVolume"].Value = 0; }
            try { cmdOperation.Parameters["@BPDStomachSize"].Value = Convert.ToDecimal(BPDStomachSize); }
            catch { cmdOperation.Parameters["@BPDStomachSize"].Value = 0; }

            cmdOperation.Parameters["@BandSize"].Value     = BandSize;
            cmdOperation.Parameters["@RouxGastric"].Value  = RouxGastric;
            cmdOperation.Parameters["@Pathway"].Value      = Pathway;
            cmdOperation.Parameters["@GeneralNotes"].Value = GeneralNotes;

            try { cmdOperation.Parameters["@DaysInHospital"].Value = Convert.ToInt16(DaysInHospital); }
            catch { cmdOperation.Parameters["@DaysInHospital"].Value = 0; }

            try { cmdOperation.Parameters["@OpWeight"].Value = Convert.ToDecimal(OpWeight); }
            catch { cmdOperation.Parameters["@OpWeight"].Value = 0; }

            strReturn = gClass.SaveOperationData(cmdOperation);

            UpdatePatientData_InPatientWeightDataTable(chkUpdateWeight == "true", OperationDate, OpWeight, SurgeryType, Approach, Category, Group, StartWeight, Imperial);

            if (AdmitID == "0") // means new Patient Data, data must be inserted
            {
                gClass.SaveUserLogFile(Context.Request.Cookies["UserPracticeCode"].Value,
                                       Context.Request.Cookies["Logon_UserName"].Value,
                                       Context.Request.Url.Host,
                                       "Operatoin Form", 2, "Add Operation - PID : ", "Operation Code",
                                       strReturn);
            }
            else
            {
                strReturn = AdmitID; // UPDATE, DON'T CHANGE IT!!!!
                gClass.SaveUserLogFile(Context.Request.Cookies["UserPracticeCode"].Value,
                                       Context.Request.Cookies["Logon_UserName"].Value,
                                       Context.Request.Url.Host,
                                       "Operatoin Form", 2, "Modify Operation", "Operation Code", AdmitID);
            }
        }
        catch (Exception err)
        {
            gClass.AddErrorLogData(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Url.Host,
                                   Context.Request.Cookies["Logon_UserName"].Value, "Operation  PID : " + Context.Request.Cookies["PatientID"].Value, "Data saving Operation - SaveOperationProc function", err.ToString());
            strReturn = "-1";
        }
        return(gClass.GetXmlDocument(Guid.NewGuid(), strReturn));
    }
예제 #23
0
    private void SaveVisitDocumentData(string fileName, int filetype, string strDocumentName, string strDoc_Description)
    {
        string      filePath = GetFilePath(fileName, filetype), strReturn;
        GlobalClass gClass = new GlobalClass();

        System.Data.SqlClient.SqlCommand cmdSave        = new System.Data.SqlClient.SqlCommand(),
                                         cmdSaveContent = new System.Data.SqlClient.SqlCommand();

        gClass.MakeStoreProcedureName(ref cmdSave, "sp_FileManagement_PatientDocuments_InsertData", true);
        gClass.MakeStoreProcedureName(ref cmdSaveContent, "sp_FileManagement_PatientDocumentsContent_InsertData", true);

        // Adding Parameters
        cmdSave.Parameters.Add("@OrganizationCode", System.Data.SqlDbType.Int).Value = intOrganizationCode;
        cmdSave.Parameters.Add("@UserPracticeCode", System.Data.SqlDbType.Int).Value = intUserPracticeCode;
        cmdSave.Parameters.Add("@PatientID", System.Data.SqlDbType.Int);
        cmdSave.Parameters.Add("@EventID", System.Data.SqlDbType.Int);
        cmdSave.Parameters.Add("@EventDate", System.Data.SqlDbType.DateTime);
        cmdSave.Parameters.Add("@EventLink", System.Data.SqlDbType.Char);
        cmdSave.Parameters.Add("@DocumentType", System.Data.SqlDbType.SmallInt);
        cmdSave.Parameters.Add("@DocumentFileName", System.Data.SqlDbType.VarChar, 100);
        cmdSave.Parameters.Add("@DocumentName", System.Data.SqlDbType.VarChar, 50);
        cmdSave.Parameters.Add("@DocumentFileSize", System.Data.SqlDbType.Int);
        cmdSave.Parameters.Add("@UploadDate", System.Data.SqlDbType.DateTime);
        cmdSave.Parameters.Add("@Doc_Description", System.Data.SqlDbType.VarChar, 1024);

        cmdSaveContent.Parameters.Add("@OrganizationCode", System.Data.SqlDbType.Int).Value = intOrganizationCode;
        cmdSaveContent.Parameters.Add("@UserPracticeCode", System.Data.SqlDbType.Int).Value = intUserPracticeCode;
        cmdSaveContent.Parameters.Add("@tblPatientDocumentsID", System.Data.SqlDbType.Int);
        cmdSaveContent.Parameters.Add("@ContentFile", System.Data.SqlDbType.Image);

        // Initialising Parameters
        cmdSave.Parameters["@PatientID"].Value = Convert.ToInt64(Request.Cookies["PatientID"].Value);
        if (txtHEventID.Value.Equals("0") || (txtHEventID.Value.Trim() == "0"))
        {
            txtHEventID.Value = Request.Cookies["ConsultID"].Value;
        }

        cmdSave.Parameters["@EventID"].Value = Convert.ToInt64(txtHEventID.Value);

        cmdSave.Parameters["@EventLink"].Value = listEventName.Value[0];

        try {
            if (listEventName.Value[0] == 'B')
            {
                cmdSave.Parameters["@EventDate"].Value = Convert.ToDateTime(txtDate.Text);
            }
            else
            {
                cmdSave.Parameters["@EventDate"].Value = Convert.ToDateTime(txtHEventDate.Value);
            }
        }
        catch { cmdSave.Parameters["@EventDate"].Value = DBNull.Value; }


        cmdSave.Parameters["@DocumentType"].Value     = filetype;
        cmdSave.Parameters["@DocumentFileName"].Value = fileName;
        cmdSave.Parameters["@DocumentName"].Value     = strDocumentName;
        cmdSave.Parameters["@DocumentFileSize"].Value = FileSize;
        try{ cmdSave.Parameters["@UploadDate"].Value = Convert.ToDateTime(txtDate.Text); }
        catch { cmdSave.Parameters["@UploadDate"].Value = DBNull.Value; }
        cmdSave.Parameters["@Doc_Description"].Value    = strDoc_Description;
        cmdSaveContent.Parameters["@ContentFile"].Value = oDocumentByteArray;
        try
        {
            txtHDocumentID.Value = gClass.SaveDocumentAndContent(cmdSave, cmdSaveContent).ToString();
            strReturn            = string.Empty;

            gClass.SaveActionLog(gClass.OrganizationCode,
                                 Request.Cookies["UserPracticeCode"].Value,
                                 Request.Url.Host,
                                 System.Configuration.ConfigurationManager.AppSettings["DocumentPage"].ToString(),
                                 System.Configuration.ConfigurationManager.AppSettings["LogCreate"].ToString(),
                                 "Save " + System.Configuration.ConfigurationManager.AppSettings["DocumentPage"].ToString() + " Data",
                                 Request.Cookies["PatientID"].Value,
                                 txtHDocumentID.Value);
        }
        catch (Exception err)
        {
            gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Upload Document Form", "SaveVisitDocumentData function", err.ToString());
        }
        return;
    }
예제 #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;

        gClass.OrganizationCode = Request.Cookies["OrganizationCode"].Value;

        try
        {
            gClass.LanguageCode = Request.Cookies["LanguageCode"].Value;
            txtHCulture.Value   = Request.Cookies["CultureInfo"].Value;
            if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                RegisterClientScriptBlock();
                if (!IsPostBack)
                {
                    gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value,
                                           Request.Cookies["Logon_UserName"].Value,
                                           Request.Url.Host,
                                           "Lab Form", 2, "Browse", "PatientCode",
                                           Request.Cookies["PatientID"].Value);

                    gClass.SaveActionLog(gClass.OrganizationCode,
                                         Request.Cookies["UserPracticeCode"].Value,
                                         Request.Url.Host,
                                         System.Configuration.ConfigurationManager.AppSettings["LabPage"].ToString(),
                                         System.Configuration.ConfigurationManager.AppSettings["LogRead"].ToString(),
                                         "Load " + System.Configuration.ConfigurationManager.AppSettings["LabPage"].ToString() + " List ",
                                         Request.Cookies["PatientID"].Value,
                                         "");

                    txtHPermissionLevel.Value = Request.Cookies["PermissionLevel"].Value;
                    txtHDataClamp.Value       = Request.Cookies["DataClamp"].Value;

                    if (Request.Cookies["SubmitData"].Value.IndexOf("submitbold") >= 0 || Request.Cookies["PermissionLevel"].Value == "1o" || Request.Cookies["PermissionLevel"].Value == "2t" || Request.Cookies["PermissionLevel"].Value == "3f" || Request.Cookies["PermissionLevel"].Value == "4s")
                    {
                        divBtnDelete.Style["display"] = "none";
                    }

                    if (Request.Cookies["PermissionLevel"].Value == "1o")
                    {
                        btnColl.Style["display"] = "none";
                    }
                }
            }
            else
            {
                gClass.ReturnToLoginPage(Request.Url.Host, Request.Cookies["LanguageCode"].Value, Response); return;
            }
        }
        catch (Exception err)
        {
            string strLanguageCode;
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Lab Form", "Loading Lab List (Page_Load function)", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
        LoadLabHistory();
        if (Request.QueryString.Count > 0)
        {
            if (txtHLabID.Value == "0" && Request.QueryString["PatID"].ToString() != "")
            {
                LoadLabData(Request.QueryString["PatID"].ToString());
            }
        }
        return;
    }
    public XmlDocument UpdatePatientNotes(string strPatientNotes)
    {
        string     strReturn = "";
        SqlCommand cmdUpdate = new SqlCommand();

        gClass.MakeStoreProcedureName(ref cmdUpdate, "sp_ConsultFU1_PatientWeightData_UpdatePatientNotes", true);
        cmdUpdate.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value       = Convert.ToInt32(gClass.OrganizationCode);
        cmdUpdate.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value       = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
        cmdUpdate.Parameters.Add("@PatientID", SqlDbType.Int).Value              = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
        cmdUpdate.Parameters.Add("@PatientNotes", SqlDbType.VarChar, 1024).Value = strPatientNotes;

        try
        {
            //save into log
            SqlCommand cmdSaveLog = new SqlCommand();
            gClass.MakeStoreProcedureName(ref cmdSaveLog, "sp_PatientDataLog_cmdInsert", true);
            cmdSaveLog.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value    = Convert.ToInt32(gClass.OrganizationCode);
            cmdSaveLog.Parameters.Add("@PatientId", SqlDbType.Int).Value           = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
            cmdSaveLog.Parameters.Add("@LogUserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
            cmdSaveLog.Parameters.Add("@LogDateTime", SqlDbType.DateTime).Value    = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
            gClass.ExecuteDMLCommand(cmdSaveLog);

            cmdSaveLog = new SqlCommand();
            gClass.MakeStoreProcedureName(ref cmdSaveLog, "sp_PatientEMRLog_cmdInsert", true);
            cmdSaveLog.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value    = Convert.ToInt32(gClass.OrganizationCode);
            cmdSaveLog.Parameters.Add("@PatientId", SqlDbType.Int).Value           = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
            cmdSaveLog.Parameters.Add("@LogUserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
            cmdSaveLog.Parameters.Add("@LogDateTime", SqlDbType.DateTime).Value    = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
            gClass.ExecuteDMLCommand(cmdSaveLog);

            cmdSaveLog = new SqlCommand();
            gClass.MakeStoreProcedureName(ref cmdSaveLog, "sp_PatientWeightDataLog_cmdInsert", true);
            cmdSaveLog.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value    = Convert.ToInt32(gClass.OrganizationCode);
            cmdSaveLog.Parameters.Add("@PatientId", SqlDbType.Int).Value           = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
            cmdSaveLog.Parameters.Add("@LogUserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
            cmdSaveLog.Parameters.Add("@LogDateTime", SqlDbType.DateTime).Value    = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
            cmdSaveLog.Parameters.Add("@PageNo", SqlDbType.Int).Value = 2;
            gClass.ExecuteDMLCommand(cmdSaveLog);

            cmdSaveLog = new SqlCommand();
            gClass.MakeStoreProcedureName(ref cmdSaveLog, "sp_PatientDataLog_SaveBoldData", true);
            cmdSaveLog.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value    = Convert.ToInt32(gClass.OrganizationCode);
            cmdSaveLog.Parameters.Add("@PatientId", SqlDbType.Int).Value           = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
            cmdSaveLog.Parameters.Add("@LogUserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
            cmdSaveLog.Parameters.Add("@LogDateTime", SqlDbType.DateTime).Value    = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
            gClass.ExecuteDMLCommand(cmdSaveLog);



            gClass.SavePatientWeightData(cmdUpdate);
            strReturn = string.Empty;

            gClass.SaveUserLogFile(Context.Request.Cookies["UserPracticeCode"].Value,
                                   Context.Request.Cookies["Logon_UserName"].Value,
                                   Context.Request.Url.Host, "Visit Form", 2, "Save Patient General data", "Patient ID", Context.Request.Cookies["PatientID"].Value);
        }
        catch (Exception err)
        {
            strReturn = err.ToString();
            gClass.AddErrorLogData(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Url.Host,
                                   Context.Request.Cookies["Logon_UserName"].Value, "Visit Form", "Save Patient General data - UpdatePatientNotes function", err.ToString());
        }
        return(gClass.GetXmlDocument(Guid.NewGuid(), strReturn));
    }
예제 #26
0
    private string SaveVisitDocumentData(string patientID, string eventID, string eventDate, string eventLink, string uploadDate, int fileType, string strDocumentName, string strDocDescription)
    {
        /*
         * //try to update if file already uploaded as baseline
         * gClass.MakeStoreProcedureName(ref cmdUpdate, "sp_FileManagement_PatientDocuments_UpdateData", true);
         * cmdUpdate.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);
         * cmdUpdate.Parameters.Add("@PatientId", SqlDbType.Int).Value = Convert.ToInt32(Request.Cookies["PatientID"].Value);
         * cmdUpdate.Parameters.Add("@DocumentFileName", System.Data.SqlDbType.VarChar, 100).Value = strDocumentName;
         * cmdUpdate.Parameters.Add("@EventID", System.Data.SqlDbType.Int).Value = Convert.ToInt64(eventID);
         * cmdUpdate.Parameters.Add("@EventDate", System.Data.SqlDbType.DateTime);
         * cmdUpdate.Parameters.Add("@EventLink", System.Data.SqlDbType.Char).Value = eventLink;
         * cmdUpdate.Parameters.Add("@DocumentName", System.Data.SqlDbType.VarChar, 50).Value = strDocDescription;
         *
         * try{cmdUpdate.Parameters["@EventDate"].Value = Convert.ToDateTime(eventDate);}
         * catch { cmdUpdate.Parameters["@EventDate"].Value = DBNull.Value; }
         *
         * try
         * {
         *  gClass.ExecuteDMLCommand(cmdUpdate);
         *
         *  gClass.SaveUserLogFile(Request.Cookies["UserPracticeCode"].Value, Request.Cookies["Logon_UserName"].Value, Request.Url.Host,
         *                      "Upload Document Form", "Update visit document function", err.ToString());
         * }
         */

        GlobalClass gClass    = new GlobalClass();
        string      strReturn = "";

        System.Data.SqlClient.SqlCommand cmdSave = new System.Data.SqlClient.SqlCommand(), cmdSaveContent = new System.Data.SqlClient.SqlCommand();

        gClass.MakeStoreProcedureName(ref cmdSave, "sp_FileManagement_PatientDocuments_InsertData", true);
        gClass.MakeStoreProcedureName(ref cmdSaveContent, "sp_FileManagement_PatientDocumentsContent_InsertData", true);

        // Adding Parameters
        cmdSave.Parameters.Add("@OrganizationCode", System.Data.SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);
        cmdSave.Parameters.Add("@UserPracticeCode", System.Data.SqlDbType.Int).Value = Convert.ToInt32(Request.Cookies["UserPracticeCode"].Value);
        cmdSave.Parameters.Add("@PatientID", System.Data.SqlDbType.Int).Value        = Convert.ToInt64(patientID);
        cmdSave.Parameters.Add("@EventID", System.Data.SqlDbType.Int);
        cmdSave.Parameters.Add("@EventDate", System.Data.SqlDbType.DateTime);
        cmdSave.Parameters.Add("@EventLink", System.Data.SqlDbType.Char);
        cmdSave.Parameters.Add("@DocumentType", System.Data.SqlDbType.SmallInt);
        cmdSave.Parameters.Add("@DocumentFileName", System.Data.SqlDbType.VarChar, 100);
        cmdSave.Parameters.Add("@DocumentName", System.Data.SqlDbType.VarChar, 50);
        cmdSave.Parameters.Add("@DocumentFileSize", System.Data.SqlDbType.Int);
        cmdSave.Parameters.Add("@UploadDate", System.Data.SqlDbType.DateTime);
        cmdSave.Parameters.Add("@Doc_Description", System.Data.SqlDbType.VarChar, 1024);

        cmdSaveContent.Parameters.Add("@OrganizationCode", System.Data.SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);
        cmdSaveContent.Parameters.Add("@UserPracticeCode", System.Data.SqlDbType.Int).Value = Convert.ToInt32(Request.Cookies["UserPracticeCode"].Value);
        cmdSaveContent.Parameters.Add("@tblPatientDocumentsID", System.Data.SqlDbType.Int);
        cmdSaveContent.Parameters.Add("@ContentFile", System.Data.SqlDbType.Image);

        // Initialising Parameters
        cmdSave.Parameters["@EventID"].Value = Convert.ToInt64(eventID);

        cmdSave.Parameters["@EventLink"].Value = eventLink;

        try
        {
            cmdSave.Parameters["@EventDate"].Value = Convert.ToDateTime(eventDate);
        }
        catch { cmdSave.Parameters["@EventDate"].Value = DBNull.Value; }


        cmdSave.Parameters["@DocumentType"].Value     = fileType;
        cmdSave.Parameters["@DocumentFileName"].Value = strDocumentName;
        cmdSave.Parameters["@DocumentName"].Value     = strDocDescription;
        cmdSave.Parameters["@DocumentFileSize"].Value = FileSize;
        try { cmdSave.Parameters["@UploadDate"].Value = Convert.ToDateTime(eventDate); }
        catch { cmdSave.Parameters["@UploadDate"].Value = DBNull.Value; }
        cmdSave.Parameters["@Doc_Description"].Value    = strDocDescription;
        cmdSaveContent.Parameters["@ContentFile"].Value = oDocumentByteArray;

        try
        {
            if (FileSize > 0)
            {
                strReturn = gClass.SaveDocumentAndContent(cmdSave, cmdSaveContent).ToString();
            }
        }
        catch (Exception err)
        {
            gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "Upload Document Form", "Import document function", err.ToString());
        }
        return(strReturn);
    }
예제 #27
0
    protected void btnForgotPassword_OnClick(object sender, EventArgs e)
    {
        String newPassword = "";

        String url      = Request.Url.Host;
        String userName = txtUserID.Text.Trim();

        if (userName.Length > 0)
        {
            String     strScript        = String.Empty;
            SqlCommand cmdSelect        = new SqlCommand();
            SqlCommand cmdSave          = new SqlCommand();
            SqlCommand cmdDelete        = new SqlCommand();
            SqlCommand cmdActivate      = new SqlCommand();
            DataSet    dsResult         = new DataSet();
            Int32      UserPracticeCode = 0;
            String     UserFirstName    = "";
            String     UserSurName      = "";
            String     UserID           = "";
            String     AdminEmail       = "";
            String     EmailBody        = "";
            String     EmailSubject     = "";
            String     CCEmail          = "*****@*****.**";
            String     FromEmail        = "*****@*****.**";
            String     AuthUsername     = "******";
            String     AuthPassword     = "******";

            try
            {
                gClass.MakeStoreProcedureName(ref cmdSelect, "sp_UsersManagement_CheckUserExist", true);
                cmdSelect.Parameters.Add("@UserID", SqlDbType.VarChar, 25).Value            = userName;
                cmdSelect.Parameters.Add("@OrganizationName", SqlDbType.VarChar, 100).Value = Request.Url.Host.ToLower();
                dsResult = gClass.FetchData(cmdSelect, "tblResult");

                if ((dsResult.Tables.Count > 0) && (dsResult.Tables[0].Rows.Count > 0))
                {
                    UserPracticeCode = Convert.ToInt32(dsResult.Tables[0].Rows[0]["UserPracticeCode"].ToString());
                    UserFirstName    = dsResult.Tables[0].Rows[0]["User_Name"].ToString();
                    UserSurName      = dsResult.Tables[0].Rows[0]["User_Sirname"].ToString();
                    UserID           = dsResult.Tables[0].Rows[0]["UserID"].ToString();
                    AdminEmail       = dsResult.Tables[0].Rows[0]["AdminEmail"].ToString();

                    //if there are no admin email, send it to ccemail, and empty the cc email
                    if (AdminEmail == "")
                    {
                        AdminEmail = CCEmail;
                        CCEmail    = "";
                    }

                    //delete password history & ask user to change it in next login
                    gClass.MakeStoreProcedureName(ref cmdDelete, "sp_UsersManagement_DeletePasswordHistory", false);
                    cmdDelete.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value = UserPracticeCode;
                    gClass.ExecuteDMLCommand(cmdDelete);

                    //set new password
                    newPassword = GeneratePassword(6);
                    gClass.MakeStoreProcedureName(ref cmdSave, "sp_UsersManagement_SaveData", false);
                    cmdSave.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value       = UserPracticeCode;
                    cmdSave.Parameters.Add("@UserID", SqlDbType.VarChar, 25).Value         = UserID;        //not used
                    cmdSave.Parameters.Add("@UserPW", SqlDbType.VarBinary, 50).Value       = gClass.GetSecureBinaryData(newPassword);
                    cmdSave.Parameters.Add("@BlankPwd", SqlDbType.Bit).Value               = false;         //not used
                    cmdSave.Parameters.Add("@User_Name", SqlDbType.VarChar, 50).Value      = UserFirstName; //not used
                    cmdSave.Parameters.Add("@User_SirName", SqlDbType.VarChar, 50).Value   = UserSurName;   //not used
                    cmdSave.Parameters.Add("@PermissionLevel", SqlDbType.VarChar, 3).Value = "";            //not used
                    cmdSave.Parameters.Add("@UpdatePassword", SqlDbType.Int).Value         = 1;
                    cmdSave.Parameters.Add("@SurgeonID", SqlDbType.Int).Value              = 0;             //not used
                    cmdSave.Parameters.Add("@ShowLog", SqlDbType.Bit).Value      = false;                   //not used
                    cmdSave.Parameters.Add("@ShowRegistry", SqlDbType.Bit).Value = false;                   //not used
                    gClass.ExecuteDMLCommand(cmdSave);

                    //activate user
                    gClass.MakeStoreProcedureName(ref cmdActivate, "sp_UsersManagement_ActivateUser", false);
                    cmdActivate.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value             = UserPracticeCode;
                    cmdActivate.Parameters.Add("@UserID", SqlDbType.VarChar, 25).Value               = String.Empty; //not used
                    cmdActivate.Parameters.Add("@strOrganizationName", SqlDbType.VarChar, 100).Value = String.Empty; //not used
                    cmdActivate.Parameters.Add("@PermissionFlag", SqlDbType.Int).Value               = 1;
                    gClass.ExecuteDMLCommand(cmdActivate);

                    EmailSubject = "Password change request from " + url;
                    EmailBody    = UserID + " has requested reactivating their account. Their new password is " + newPassword + ". Please ensure they are made aware of their new password - this has not been sent to them directly. This is a temporary password which will have to be changed to their own when they first login. Thank you<br><br>Lapbase";

                    //if admin empty, send to help
                    //else send to admin and help
                    //SendMail(AuthUsername, AuthPassword, "*****@*****.**", FromEmail, "", EmailSubject, EmailBody);

                    SendMail(AuthUsername, AuthPassword, AdminEmail, FromEmail, CCEmail, EmailSubject, EmailBody);

                    //email sent notification
                    strScript  = "";
                    strScript += "document.getElementById('divErrorMessage').style.display = 'none';";
                    strScript += "document.getElementById('tblContent').style.display = 'none';";
                    strScript += "SetInnerText(document.getElementById('lblForm'), 'Your request to unlock your account is being processed with a new Password being issued. Once issued, your new password will be sent to your Practice Administrator enabling you to unlock your account.');";
                    ScriptManager.RegisterStartupScript(btnForgotPassword, btnForgotPassword.GetType(), "key", strScript, true);
                }
                else
                {
                    //user not exist
                    strScript  = "";
                    strScript += "SetInnerText(document.getElementById('pErrorMessage'), 'Your username does not exist');";
                    strScript += "document.getElementById('divErrorMessage').style.display = 'block';";
                    ScriptManager.RegisterStartupScript(btnForgotPassword, btnForgotPassword.GetType(), "key", strScript, true);
                }
            }
            catch (Exception err)
            {
                gClass.AddErrorLogData("User", Context.Request.Url.Host,
                                       "User", userName, "Forgot Password or Activate", "" + "" + err.ToString());
            }
        }
    }
    public XmlDocument Complication_SaveProc(string ComplicationCode, string ComplicationDate, string TypeCode, string Complication, int Readmitted, int ReOperation,
                                             string Notes, int ComplicationID, String FacilityCode, String Facility_Other, String AdverseSurgery, String DoctorID, String DateCreated,
                                             string AdmitDate, string DischargeDate, string PerformDate, string Reason)
    {
        int    Result = Complication_CanToSave(ComplicationDate);
        string temp;

        try
        {
            if (Result == 0) // All data are OK and ready to save
            {
                SqlCommand cmdSave     = new SqlCommand();
                SqlCommand cmdBoldSave = new SqlCommand();
                Int32      intTemp     = 0;
                DateTime   dtTemp;
                SqlCommand cmdSelect = new SqlCommand();
                Boolean    blnInsert;
                Int32      intCompNum     = 0;
                DataSet    dsAdverseEvent = new DataSet();

                if (ComplicationID == 0)
                {
                    gClass.MakeStoreProcedureName(ref cmdSave, "sp_ConsultFU1_Complications_InsertData", true);
                    cmdSave.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);
                    cmdSave.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
                    cmdSave.Parameters.Add("@DateCreated", SqlDbType.DateTime);
                    if (DateTime.TryParse(DateCreated, out dtTemp))
                    {
                        cmdSave.Parameters["@DateCreated"].Value = dtTemp;
                    }
                    else
                    {
                        cmdSave.Parameters["@DateCreated"].Value = DBNull.Value;
                    }
                    blnInsert = true;
                }
                else
                {
                    gClass.MakeStoreProcedureName(ref cmdSave, "sp_ConsultFU1_Complications_UpdateData", true);
                    cmdSave.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value   = Convert.ToInt32(gClass.OrganizationCode);
                    cmdSave.Parameters.Add("@tblComplicationsID", SqlDbType.Int).Value = Convert.ToInt32(ComplicationID);
                    blnInsert = false;
                }

                cmdSave.Parameters.Add("@PatientId", SqlDbType.Int).Value = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
                cmdSave.Parameters.Add("@ComplicationDate", SqlDbType.DateTime);

                if (DateTime.TryParse(ComplicationDate, out dtTemp))
                {
                    cmdSave.Parameters["@ComplicationDate"].Value = dtTemp;
                }
                else
                {
                    cmdSave.Parameters["@ComplicationDate"].Value = DBNull.Value;
                }

                cmdSave.Parameters.Add("@ComplicationCode", SqlDbType.VarChar, 10).Value = ComplicationCode;
                cmdSave.Parameters.Add("@TypeCode", SqlDbType.VarChar, 1).Value          = TypeCode;
                cmdSave.Parameters.Add("@Notes", SqlDbType.VarChar, 255).Value           = Notes.Replace("'", "`");
                cmdSave.Parameters.Add("@Complication", SqlDbType.VarChar, 100).Value    = Complication;;
                cmdSave.Parameters.Add("@Readmitted", SqlDbType.Bit).Value  = Readmitted;
                cmdSave.Parameters.Add("@ReOperation", SqlDbType.Bit).Value = ReOperation;

                cmdSave.Parameters.Add("@AdmitDate", SqlDbType.DateTime);
                cmdSave.Parameters.Add("@DischargeDate", SqlDbType.DateTime);
                cmdSave.Parameters.Add("@PerformDate", SqlDbType.DateTime);

                if (DateTime.TryParse(AdmitDate, out dtTemp))
                {
                    cmdSave.Parameters["@AdmitDate"].Value = dtTemp;
                }
                else
                {
                    cmdSave.Parameters["@AdmitDate"].Value = DBNull.Value;
                }

                if (DateTime.TryParse(DischargeDate, out dtTemp))
                {
                    cmdSave.Parameters["@DischargeDate"].Value = dtTemp;
                }
                else
                {
                    cmdSave.Parameters["@DischargeDate"].Value = DBNull.Value;
                }

                if (DateTime.TryParse(PerformDate, out dtTemp))
                {
                    cmdSave.Parameters["@PerformDate"].Value = dtTemp;
                }
                else
                {
                    cmdSave.Parameters["@PerformDate"].Value = DBNull.Value;
                }

                cmdSave.Parameters.Add("@Reason", SqlDbType.VarChar, 10).Value = Reason;

                cmdSave.Parameters.Add("@FacilityCode", SqlDbType.VarChar, 10).Value    = FacilityCode;
                cmdSave.Parameters.Add("@Facility_Other", SqlDbType.VarChar, 100).Value = Facility_Other;
                cmdSave.Parameters.Add("@AdverseSurgery", SqlDbType.VarChar, 255).Value = AdverseSurgery;
                cmdSave.Parameters.Add("@DoctorID", SqlDbType.Int).Value = (Int32.TryParse(DoctorID, out intTemp) ? intTemp : 0);



                //insert log
                //before updating data
                if (blnInsert == false)
                {
                    try
                    {
                        SqlCommand cmdSaveLog = new SqlCommand();
                        gClass.MakeStoreProcedureName(ref cmdSaveLog, "sp_ConsultFU1_ComplicationsLog_InsertData", true);
                        cmdSaveLog.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value    = Convert.ToInt32(gClass.OrganizationCode);
                        cmdSaveLog.Parameters.Add("@ComplicationNum", SqlDbType.Int).Value     = Convert.ToInt32(ComplicationID);
                        cmdSaveLog.Parameters.Add("@LogUserPracticeCode", SqlDbType.Int).Value = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
                        cmdSaveLog.Parameters.Add("@LogDateTime", SqlDbType.DateTime).Value    = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
                        gClass.ExecuteDMLCommand(cmdSaveLog);
                    }
                    catch (Exception err)
                    {
                        gClass.AddErrorLogData(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Url.Host,
                                               Context.Request.Cookies["Logon_UserName"].Value, "Complication  PID : " + Context.Request.Cookies["PatientID"].Value, "Data Saving Complication Log", err.ToString());
                    }
                }
                gClass.ExecuteDMLCommand(cmdSave);

                gClass.SaveUserLogFile(Context.Request.Cookies["UserPracticeCode"].Value,
                                       Context.Request.Cookies["Logon_UserName"].Value,
                                       Context.Request.Url.Host,
                                       "Complication Form", 2, "Save Complication Data " + ((ComplicationID == 0) ? "Insert" : "Update"), "PatientCode",
                                       Context.Request.Cookies["PatientID"].Value);

                if (blnInsert)
                {
                    gClass.MakeStoreProcedureName(ref cmdSelect, "sp_ConsultFU1_Complications_GetLastComplicationID", true);
                    cmdSelect.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value = Convert.ToInt32(gClass.OrganizationCode);
                    cmdSelect.Parameters.Add("@PatientId", SqlDbType.Int).Value        = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
                    dsAdverseEvent = gClass.FetchData(cmdSelect, "tblAdverseEvent");
                    if (dsAdverseEvent.Tables[0].Rows.Count > 0)
                    {
                        intCompNum = Convert.ToInt32(dsAdverseEvent.Tables[0].Rows[0]["ComplicationNum"].ToString());
                    }
                }
                else
                {
                    intCompNum = Convert.ToInt32(ComplicationID);
                }

                gClass.SaveActionLog(gClass.OrganizationCode,
                                     Context.Request.Cookies["UserPracticeCode"].Value,
                                     Context.Request.Url.Host,
                                     System.Configuration.ConfigurationManager.AppSettings["ComplicationPage"].ToString(),
                                     ((blnInsert) ? System.Configuration.ConfigurationManager.AppSettings["LogCreate"].ToString() : System.Configuration.ConfigurationManager.AppSettings["LogUpdate"].ToString()),
                                     "Save " + System.Configuration.ConfigurationManager.AppSettings["ComplicationPage"].ToString() + " Data ",
                                     Context.Request.Cookies["PatientID"].Value,
                                     Convert.ToString(intCompNum));

                //save to bold table
                gClass.MakeStoreProcedureName(ref cmdBoldSave, "sp_ConsultFU1_Complications_SaveBoldData", true);
                cmdBoldSave.Parameters.Add("@OrganizationCode", SqlDbType.Int).Value         = Convert.ToInt32(gClass.OrganizationCode);
                cmdBoldSave.Parameters.Add("@UserPracticeCode", SqlDbType.Int).Value         = Convert.ToInt32(Context.Request.Cookies["UserPracticeCode"].Value);
                cmdBoldSave.Parameters.Add("@ComplicationNum", SqlDbType.Int).Value          = intCompNum;
                cmdBoldSave.Parameters.Add("@PatientId", SqlDbType.Int).Value                = Convert.ToInt32(Context.Request.Cookies["PatientID"].Value);
                cmdBoldSave.Parameters.Add("@ComplicationCode", SqlDbType.VarChar, 10).Value = ComplicationCode;
                cmdBoldSave.Parameters.Add("@ComplicationDate", SqlDbType.DateTime);
                if (DateTime.TryParse(ComplicationDate, out dtTemp))
                {
                    cmdBoldSave.Parameters["@ComplicationDate"].Value = dtTemp;
                }
                else
                {
                    cmdBoldSave.Parameters["@ComplicationDate"].Value = DBNull.Value;
                }
                cmdBoldSave.Parameters.Add("@FacilityCode", SqlDbType.VarChar, 10).Value    = FacilityCode;
                cmdBoldSave.Parameters.Add("@AdverseSurgery", SqlDbType.VarChar, 255).Value = AdverseSurgery;
                cmdBoldSave.Parameters.Add("@DoctorID", SqlDbType.Int).Value = (Int32.TryParse(DoctorID, out intTemp) ? intTemp : 0);

                gClass.ExecuteDMLCommand(cmdBoldSave);

                //BOLD validation
                //only check if BOLD mode is on
                if (Context.Request.Cookies["SubmitData"].Value.IndexOf("submitbold") >= 0)
                {
                    SubmitBOLDAdverseEventData(intCompNum);
                }
                gClass.SaveUserLogFile(Context.Request.Cookies["UserPracticeCode"].Value,
                                       Context.Request.Cookies["Logon_UserName"].Value,
                                       Context.Request.Url.Host,
                                       "Complication Form", 2, "Save Complication Bold Data " + ((ComplicationID == 0) ? "Insert" : "Update"), "PatientCode",
                                       Context.Request.Cookies["PatientID"].Value);


                gClass.SaveActionLog(gClass.OrganizationCode,
                                     Context.Request.Cookies["UserPracticeCode"].Value,
                                     Context.Request.Url.Host,
                                     System.Configuration.ConfigurationManager.AppSettings["ComplicationPage"].ToString(),
                                     ((blnInsert) ? System.Configuration.ConfigurationManager.AppSettings["LogCreate"].ToString() : System.Configuration.ConfigurationManager.AppSettings["LogUpdate"].ToString()),
                                     "Save " + System.Configuration.ConfigurationManager.AppSettings["ComplicationPage"].ToString() + " BOLD Data ",
                                     Context.Request.Cookies["PatientID"].Value,
                                     Convert.ToString(intCompNum));
            }
            temp = Result.ToString();
        }
        catch (Exception err)
        {
            temp = err.ToString();
            gClass.AddErrorLogData(Context.Request.Cookies["UserPracticeCode"].Value, Context.Request.Url.Host, Context.Request.Cookies["Logon_UserName"].Value, "Complication Form", "Complication_SaveProc Proc", err.ToString());
        }
        return(gClass.GetXmlDocument(Guid.NewGuid(), temp));
    }
예제 #29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string strScript = String.Empty;

        try
        {
            if (!IsPostBack)
            {
                txtHost.Value = Request.Url.Host.ToLower();
                //MakeConnectionString("SqlDBConnectionString");
                LoadAllOrganizationData();
                //LoadAllUsersData();
                //FillOrganizationList();
                FillLanguageList();
                FillDefaultSortList();
                FillSubmitDataList();
            }
        }
        catch (Exception ex)
        {
            strScript = "HideDivMessage();document.getElementById('divErrorMessage').style.display = 'block';SetInnerText(document.getElementById('pErrorMessage'), 'Error in Saving Organization data ...');ActivateElements(true);";
            gClass.AddErrorLogData("0", Request.Url.Host, "", "linkbtnSaveOrganization_onclick", "Add new organization", ex.ToString());
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        bool   LoadFlag = true;
        string strLanguageCode = "", strURL, strRawUrl;

        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "no-cache");
        Response.Expires = -1;

        strURL    = Request.Url.ToString().Replace(" ", "").Replace("%20", "");
        strRawUrl = Request.RawUrl.Replace(" ", "").Replace("%20", "");

        try
        {
            Page.Culture             = Request.Cookies["CultureInfo"].Value;
            gClass.OrganizationCode  = Request.Cookies["OrganizationCode"].Value;
            txtHApplicationURL.Value = Request.Url.Scheme + "://" + Request.Url.Host + Request.ApplicationPath + "/";
            lblPatientID.Text        = Request.Cookies["PatientID"].Value;
            txtHCulture.Value        = Request.Cookies["CultureInfo"].Value;

            if (gClass.IsUserLogoned(Session.SessionID, Request.Cookies["UserPracticeCode"].Value, Request.Url.Host))
            {
                if (!IsPostBack)
                {
                    bodyFileManagement.Attributes.Add("onload", "javascript:InitializePage('" + Request.QueryString["QSN"].ToUpper() + "')");
                }

                gClass.SaveActionLog(gClass.OrganizationCode,
                                     Request.Cookies["UserPracticeCode"].Value,
                                     Request.Url.Host,
                                     System.Configuration.ConfigurationManager.AppSettings["DocumentPage"].ToString(),
                                     System.Configuration.ConfigurationManager.AppSettings["LogRead"].ToString(),
                                     "Load " + System.Configuration.ConfigurationManager.AppSettings["DocumentPage"].ToString() + " List",
                                     "",
                                     "");

                if (Request.Cookies["PermissionLevel"].Value == "1o")
                {
                    btnUpload.Style["display"] = "none";
                }
            }
            else
            {
                LoadFlag        = false;
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
            }
        }
        catch (Exception err)
        {
            try
            {
                strLanguageCode = Request.Cookies["LanguageCode"].Value;
                gClass.AddErrorLogData(Request.Cookies["UserPracticeCode"].Value, Request.Url.Host, Request.Cookies["Logon_UserName"].Value, "File Management Form", "Loading Files Data (Page_Load function)", err.ToString());
            }
            catch { strLanguageCode = "en-US"; }

            LoadFlag = false;
        }

        if (LoadFlag && Request.QueryString["ReLoad"].Equals("0")) // Call by AJAX function from FileManagement.JS
        {
            Response.Clear();
            switch (Request.QueryString["QSN"].ToUpper())
            {
            case "TYPE":
            case "TYPEDATE":
            case "DATE":
                FetchPatientGroupDocument();
                break;

            case "LOADDOCUMENTITEMS":
                FetchPatientGroupDocumentItems();
                break;

            case "LOADDOCUMENTDETAIL":
                FetchDocumentDetailInformation();
                break;

            case "LOADEVENTDATA":
                FetchEventData();
                break;

            case "LOADDOCUMENTITEMS_EVENTDATE":
                FetchPatientGroupDocumentItems_OnEventDate();
                break;

            case "LOADDOCUMENTITEMS_EVENTLINK":
                FetchPatientGroupDocumentItems_OnEventLink();
                break;

            case "DELETEDOCUMENT":
                DeleteDocument();
                break;

            case "LOADINGDOCUMENT":
                LoadDocumentContent();
                break;

            case "LOADEVENTHISTORY":
                FetchDocumentEventHistory();
                break;
            }
            Response.End();
        }
        else
        if (!LoadFlag)
        {
            gClass.ReturnToLoginPage(Request.Url.Host, strLanguageCode, Response);
        }
    }