예제 #1
0
        public string HealthMaintenanceAlertCheck(string checkAlert, int clientID)
        {
            string retValue = "failed";

            if (checkAlert != null && checkAlert == "true" && clientID >= 0)
            {
                int staffID = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserId;
                using (Streamline.UserBusinessServices.HealthMaintenanceTemplate objHealthMaintenanceTemplate = new Streamline.UserBusinessServices.HealthMaintenanceTemplate())
                {
                    DataSet ds = objHealthMaintenanceTemplate.HealthMaintenanceAlertCheck(clientID, staffID);
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        if ((ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) || clientID == 0)
                        {
                            retValue = "success";
                        }
                        if (ds.Tables[2] != null && ds.Tables[2].Rows.Count > 0)
                        {
                            retValue += "|;" + Convert.ToString(ds.Tables[2].Rows[0][0]);
                        }
                    }
                }
            }
            return(retValue);
        }
예제 #2
0
        private string InitHealthMaintenanceAlertCheck()
        {
            string _details = "";
            int    staffID  = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).UserId;

            using (Streamline.UserBusinessServices.HealthMaintenanceTemplate objHealthMaintenanceTemplate = new Streamline.UserBusinessServices.HealthMaintenanceTemplate())
            {
                DataSet ds = objHealthMaintenanceTemplate.InitHealthMaintenanceAlertCheck(staffID);
                if (ds != null && ds.Tables.Count > 0)
                {
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        _details = Convert.ToString(ds.Tables[0].Rows[0][0]);
                    }
                }
            }

            return(_details);
        }
예제 #3
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["AjaxAction"] == "saveHMTemplateUserDecisions")
            {
                string acceptedKeys = Request.QueryString["AcceptedKeys"].ToString();
                string rejectedKeys = Request.QueryString["RejectedKeys"].ToString();
                string clientIdStr  = Request.QueryString["ClientId"].ToString();
                int    clientId     = 0;
                if (clientIdStr != null && clientIdStr != "")
                {
                    clientId = Convert.ToInt32(clientIdStr);
                }
                using (Streamline.UserBusinessServices.HealthMaintenanceTemplate HealthMaintenanceObj = new Streamline.UserBusinessServices.HealthMaintenanceTemplate())
                {
                    string  pendingAlertCount = "";
                    DataSet dataSetObj        = HealthMaintenanceObj.SaveHealthMaintenaceUserDecisions(acceptedKeys, rejectedKeys, clientId);
                    if (dataSetObj != null && dataSetObj.Tables.Count > 0)
                    {
                        if (dataSetObj.Tables[0] != null && dataSetObj.Tables[0].Rows.Count > 0)
                        {
                            pendingAlertCount = dataSetObj.Tables[0].Rows[0][0].ToString();
                        }
                    }
                    Response.Clear();
                    Response.Write(pendingAlertCount);
                    Response.End();
                }
            }
            if (Request.QueryString["AjaxAction"] == "HealthMaintenanceAlertCheck")
            {
                string CheckAlert    = "true";
                int    CheckClientID = ((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId;

                string retValue = HealthMaintenanceAlertCheck(CheckAlert, CheckClientID);
                Response.Write(retValue);
                Response.End();
            }

            try
            {
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                if (Session["UserContext"] != null)
                {
                    LabelCopyrightInfo.Text = ((Streamline.BaseLayer.StreamlineIdentity)Context.User.Identity).CopyrightInfo;
                }
                if (Page.IsPostBack == false)
                {
                    try
                    {
                        bindTemplateGrid();
                    }
                    catch (Exception ex)
                    {
                        ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + ex.Message.ToString() + "', true);", true);
                    }
                }
            }
            catch (Exception ex)
            {
                if (ex.Data["CustomExceptionInformation"] == null)
                {
                    ex.Data["CustomExceptionInformation"] = "";
                }

                string ParseMessage = ex.Message;
                if (ParseMessage.IndexOf("System.Data.SqlClient.SqlException:") > 0)
                {
                    int SubstringLen = ParseMessage.IndexOf("\n") - ParseMessage.IndexOf("System.Data.SqlClient.SqlException:");
                    ParseMessage = ParseMessage.Substring(ParseMessage.IndexOf("System.Data.SqlClient.SqlException:") + 35, SubstringLen - 35);
                    //  ShowError(ParseMessage, true);
                }
                Streamline.BaseLayer.LogManager.LogException(ex, LogManager.LoggingCategory.General, LogManager.LoggingLevel.Error, this);
                ScriptManager.RegisterStartupScript(LabelError, LabelError.GetType(), ClientID.ToString(), "ShowError('" + ex.Message.ToString() + "', true);", true);
            }
        }