Beispiel #1
0
        protected void ExecutionConfirmed(object sender, EventArgs e)
        {
            panelMain.Visible = true;
            confirmPanel.Visible = false;

            System.ServiceProcess.ServiceController sc = new System.ServiceProcess.ServiceController("EOBProcessing");

            try
            {
                sc.Stop();
                System.Threading.Thread.Sleep(5000);

                dbProcedures db = new dbProcedures();
                System.Data.SqlClient.SqlCommand sqlCmd = new System.Data.SqlClient.SqlCommand("usp_AddOneTimeRunSchedule", new db().SqlConnection);
                sqlCmd.CommandType = System.Data.CommandType.StoredProcedure;

                sqlCmd.ExecuteNonQuery();
                db.Close();

                sc.Start();
                lblMessage.Text = "EOB System manual execution started.";

            }
            catch (Exception e1)
            {
                lblMessage.Text = "Failed to manually start EOB System service." + e1.Message();
            }
        }
        public void GetMemberDetail(int MemberId)
        {
            dbProcedures db = new dbProcedures();
            System.Data.SqlClient.SqlDataReader reader;

            reader = db.GetMemberDetail(MemberId);

            try
            {
                if (reader.Read())
                {
                    if ((!object.ReferenceEquals(reader[0], System.DBNull.Value)))
                    {
                        lblMemberId.Text = reader[0].ToString();

                        txtUsername.Text = reader[1].ToString();
                        txtPassword.Text = reader[2].ToString();
                        cbInvalidPassword.Checked = Convert.ToBoolean(reader[3].ToString());
                        cbInactive.Checked = Convert.ToBoolean(reader[4].ToString());
                        txtFirstName.Text = reader[5].ToString();
                        txtLastName.Text = reader[6].ToString();

                        txtCarrier.Items.Add(new ListItem("Blue Shield CA", "BlueShieldCA"));
                        txtCarrier.Items.Add(new ListItem("Anthem", "Anthem"));
                        txtCarrier.SelectedValue = reader[7].ToString();

                        txtEmployerGroup.Text = reader[8].ToString();
                        lblCreationTS.Text = reader[9].ToString();
                        lblUpdatedTS.Text = reader[10].ToString();

                    }
                    else
                    {
                        lblMemberId.Text = "Error retrieving member detail.";

                        btnDelete.Visible = false;
                        btnUpdate.Visible = false;
                    }
                }
            }
            catch (Exception e)
            {
                lblMemberId.Text = "Error retrieving member detail.";
                btnDelete.Visible = false;
                btnUpdate.Visible = false;
            }

            reader.Close();
            db.Close();
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                if (txtEmail.Text.Length > 0 && txtPassword.Text.Length > 0)
                {
                    dbProcedures db = new dbProcedures();

                    string strPasswordHash = db.GetAccountHash(txtEmail.Text);

                    if (strPasswordHash.Length > 0)
                    {
                        if (PasswordHash.PasswordHash.ValidatePassword(txtPassword.Text, strPasswordHash))
                        {
                            Session["revei"] = db.CreateSession(txtEmail.Text, Request.UserHostAddress);
                            Response.Redirect("/dashboard");
                        }
                    }

                    db.Close();
                }

                txtPassword.Text = "";
                lblMessage.Text = "Invalid login.";
            }
            else
            {
                if (Session["otanalytics"] != null)
                {
                    if (Session["otanalytics"].ToString().Length > 0)
                    {
                        dbProcedures db = new dbProcedures();
                        if (db.ValidateSessionKey(Session["otanalytics"].ToString(), Request.UserHostAddress))
                        {
                            Response.Redirect("/dashboard");
                        }

                        db.Close();
                    }
                }

            }
        }
        protected void btnCreate_Click(object sender, EventArgs e)
        {
            dbProcedures db = new dbProcedures();

            int MemberId = 0;

            MemberId = db.CreateNewMember(txtUsername.Text, txtPassword.Text, cbInvalidPassword.Checked, cbInactive.Checked, txtFirstName.Text, txtLastName.Text, txtCarrier.SelectedValue, txtEmployerGroup.Text);
            db.Close();

            if (MemberId == -1)
            {
                Session["strMemberId"] = "";
                lblMemberId.Text = "Username already exists!";
                lblMemberId.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                Response.Redirect("~/MemberDetail.aspx?id=" + MemberId);
            }
        }
        public void MemberSearch(string strUsername)
        {
            dbProcedures db = new dbProcedures();

            try
            {
                System.Data.SqlClient.SqlCommand sqlCmd = new System.Data.SqlClient.SqlCommand("SELECT * FROM tbl_Members WHERE Username like '%" + strUsername + "%' ORDER BY Username", new db().SqlConnection);
                sqlCmd.CommandType = System.Data.CommandType.Text;

                System.Data.DataTable loadReaderdata = new System.Data.DataTable();
                loadReaderdata.Load(sqlCmd.ExecuteReader());

                GridView1.DataSource = loadReaderdata;
                GridView1.DataBind();
            }
            catch (Exception ex)
            {
                db.LogAction("", "Error", "Error loading Members UI page. " + ex.Message.ToString());
            }

            db.Close();
        }
        public void FilterResults(Object sender, EventArgs a)
        {
            dbProcedures db = new dbProcedures();

            try
            {
                System.Data.SqlClient.SqlCommand sqlCmd = new System.Data.SqlClient.SqlCommand("SELECT * FROM tbl_Members WHERE Firstname + ' ' + LastName like '%" + txtEmployeeName.Text + "%' AND EmployerGroup like '%" + ddlEmployerGroup.SelectedValue + "%' ORDER BY Username", new db().SqlConnection);
                sqlCmd.CommandType = System.Data.CommandType.Text;

                System.Data.DataTable loadReaderdata = new System.Data.DataTable();
                loadReaderdata.Load(sqlCmd.ExecuteReader());

                GridView1.DataSource = loadReaderdata;
                GridView1.DataBind();
            }
            catch (Exception ex)
            {
                db.LogAction("", "Error", "Error loading Members UI page. " + ex.Message.ToString());
            }

            db.Close();
        }
        void PopulateLastBatchInfo()
        {
            dbProcedures db = new dbProcedures();

            System.Data.SqlClient.SqlDataReader reader = db.GetLastBatchHistory();

            if (reader.Read())
            {
                if ((!object.ReferenceEquals(reader[0], System.DBNull.Value)))
                {
                    string strServiceStatus = new System.ServiceProcess.ServiceController("EOBProcessing").Status.ToString();

                    // Populate content
                    if (strServiceStatus.ToUpper() == "STOPPED")
                    {
                        lblWindowsServiceStatus.ForeColor = System.Drawing.Color.Red;

                    }
                    lblWindowsServiceStatus.Text = strServiceStatus;

                    string strMembersProcessed = reader[2].ToString();
                    string strNewEOBDownloads = reader[3].ToString();

                    if (strMembersProcessed.Length == 0)
                    {
                        lblLastRunDuration.Text = "Currently running...";
                        lblMembersProcessed.Text = "Currently running...";
                        lblNewEOBDownloads.Text = "Currently running...";
                    }
                    else
                    {
                        lblMembersProcessed.Text = strMembersProcessed;
                        lblNewEOBDownloads.Text = strNewEOBDownloads;
                    }

                    linkEOBRepository.Text = System.Configuration.ConfigurationManager.AppSettings.Get("EOBRepository");
                    linkEOBRepository.PostBackUrl = System.Configuration.ConfigurationManager.AppSettings.Get("EOBRepository");

                    DateTime startTime;
                    DateTime endTime;

                    startTime = Convert.ToDateTime(reader[0].ToString());
                    lblLastRunDate.Text = startTime.DayOfWeek.ToString() + ", " + startTime.ToString();

                    try
                    {
                        endTime = Convert.ToDateTime(reader[1].ToString());

                        lblLastRunDuration.Text = endTime.Subtract(startTime).Hours.ToString() + " hrs, " + endTime.Subtract(startTime).Minutes.ToString() + " mins";
                    }
                    catch (Exception e)
                    {
                    }

                }
            }

            reader.Close();
            db.Close();
        }
        public void PopulateEmployerGroupDDL()
        {
            dbProcedures db = new dbProcedures();

            try
            {
                System.Data.SqlClient.SqlCommand sqlCmd = new System.Data.SqlClient.SqlCommand("SELECT DISTINCT EmployerGroup FROM tbl_Members ORDER BY EmployerGroup", new db().SqlConnection);
                sqlCmd.CommandType = System.Data.CommandType.Text;

                System.Data.DataTable loadReaderdata = new System.Data.DataTable();
                loadReaderdata.Load(sqlCmd.ExecuteReader());

                ddlEmployerGroup.DataSource = loadReaderdata;
                ddlEmployerGroup.DataTextField = "EmployerGroup";
                ddlEmployerGroup.DataValueField = "EmployerGroup";
                ddlEmployerGroup.DataBind();

                ddlEmployerGroup.Items.Insert(0, new ListItem("", ""));
                ddlEmployerGroup.SelectedIndex = 0;

            }
            catch (Exception ex)
            {
                db.LogAction("", "Error", "Error loading Members UI page. " + ex.Message.ToString());
            }

            db.Close();
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            dbProcedures db = new dbProcedures();
            string strResult = "";

            strResult = db.UpdateMemberInfo(lblMemberId.Text, txtUsername.Text, txtPassword.Text, cbInvalidPassword.Checked, cbInactive.Checked, txtFirstName.Text, txtLastName.Text, txtCarrier.SelectedValue, txtEmployerGroup.Text);
            db.Close();

            if (strResult == "-1")
            {
                Response.Redirect("~/Members.aspx?message=ErrorUsernameAlreadyExists");
            }
            else
            {
                Response.Redirect("~/MemberDetail.aspx?id=" + lblMemberId.Text);
            }
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            dbProcedures db = new dbProcedures();

            db.DeleteMember(txtUsername.Text, txtCarrier.SelectedValue);
            db.LogAction(txtUsername.Text, "Information", "Deleted member: " + txtUsername.Text + " [" + txtCarrier.SelectedValue + "]");
            db.Close();

            Session["strMemberId"] = "";

            Response.Redirect("~/Members.aspx");
        }