Ejemplo n.º 1
0
        protected void gdvPatientDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            BALAccounts           Bal               = new BALAccounts();
            GridViewRow           row               = gdvPatientDetails.Rows[e.RowIndex];
            string                name              = (row.FindControl("lblpatientfname") as Label).Text;
            PatientDetails        patientDetails    = new PatientDetails();
            PatientDetailsSql     patientDetailsSql = new PatientDetailsSql();
            List <PatientDetails> patdetails        = patientDetailsSql.DisplayPatientDetails();

            if (patdetails.Count > 0)
            {
                for (int i = 0; i < patdetails.Count; i++)
                {
                    if (patdetails[i].FirstName1 == name)
                    {
                        patdetails.RemoveAt(i);
                    }
                }

                Bal.removepatient(name);
                lblStatusPatient.Text = "Patient Details Deleted Successfully";
                GetPatient();
            }
        }
Ejemplo n.º 2
0
 public List <PatientDetails> DisplayPatientDetail()
 {
     return(patientDetailsSql.DisplayPatientDetails());
 }
Ejemplo n.º 3
0
        protected void txtBtnLogin_Click(object sender, EventArgs e)
        {
            Session["ddlRoleList"] = ddlRoleList.SelectedValue.ToString();
            Session["txtUserName"] = txtUserName.Text;
            Session["txtpassword"] = txtpassword.Text;
            lblindex.Text          = "";
            if (ddlRoleList.SelectedValue.ToString() == "s_admin")
            {
                if ((txtUserName.Text == "vinay") && (txtpassword.Text == "123456789"))
                {
                    Response.Redirect("~/ApproveAdmin.aspx");
                }
                else
                {
                    lblMsg.Text = "Invalid Username/password ";
                }

                //var UserList = adminDetails.Where(x => x.UserName1 == txtUserName.Text && x.Password1 == txtpassword.Text).ToList();
                //if (UserList.Count > 0)
                //{
                //    if (UserList[0].Isapproved1 != true)
                //    {
                //        lblMsg.Text = "Your Account is Pending for Admin Approval";
                //    }
                //    else
                //    {
                //        lblMsg.Text = "Login successfull";
                //        Response.Redirect("~/ApproveAdmin.aspx");
                //    }
                //}
                //else
                //{
                //    lblMsg.Text = "Incorrect UserId/Password";
                //}
            }
            else if (ddlRoleList.SelectedValue.ToString() == "Admin")
            {
                AdminDetailsSql     adminDetailsSql = new AdminDetailsSql();
                List <AdminDetails> adminDetails    = adminDetailsSql.DisplayAdminDetails();
                var UserList = adminDetails.Where(x => x.UserName1 == txtUserName.Text && x.Password1 == txtpassword.Text).ToList();
                if (UserList.Count > 0)
                {
                    if (UserList[0].Isapproved1 != true)
                    {
                        lblMsg.Text = "Your Account is Pending for Admin Approval";
                    }
                    else
                    {
                        lblMsg.Text = "Login successfull";
                        Response.Redirect("~/Admin.aspx");
                    }
                }
                else
                {
                    lblMsg.Text = "Incorrect UserId/Password";
                    ClientScript.RegisterStartupScript(this.GetType(), "Popup", "successalert();", true);
                }
            }
            else if (ddlRoleList.SelectedValue == "Doctor")
            {
                DoctorDetailsSql     doctorDetailsSql = new DoctorDetailsSql();
                List <DoctorDetails> doctorDetails    = doctorDetailsSql.DisplayDoctorDetails();
                var UserList = doctorDetails.Where(x => x.UserName1 == txtUserName.Text && x.Password1 == txtpassword.Text).ToList();
                if (UserList.Count > 0)
                {
                    Session["DoctorId"] = UserList[0].DoctorID1;
                    if (UserList[0].Isapproved1 != true)
                    {
                        lblMsg.Text = "Your Account is Pending for Admin Approval";
                    }
                    else
                    {
                        lblMsg.Text = "Login successfull";
                        Response.Redirect("~/Doctor.aspx");
                    }
                }
                else
                {
                    lblMsg.Text = "Incorrect UserId/Password";
                    ClientScript.RegisterStartupScript(this.GetType(), "Popup", "successalert();", true);
                }
            }
            else if (ddlRoleList.SelectedValue == "Patient")
            {
                PatientDetailsSql     patientDetailsSql = new PatientDetailsSql();
                List <PatientDetails> patientDetails    = patientDetailsSql.DisplayPatientDetails();
                var UserList = patientDetails.Where(x => x.UserName1 == txtUserName.Text && x.Password1 == txtpassword.Text).ToList();
                if (UserList.Count > 0)
                {
                    Session["Patientid"] = UserList[0].Patientid1;
                    if (UserList[0].Isapproved1 != true)
                    {
                        lblMsg.Text = "Your Account is Pending for Admin Approval";
                    }
                    else
                    {
                        lblMsg.Text = "Login successfull";
                        Response.Redirect("~/Patient.aspx");
                    }
                }
                else
                {
                    lblMsg.Text = "Incorrect UserId/Password";
                    ClientScript.RegisterStartupScript(this.GetType(), "Popup", "successalert();", true);
                }
            }
            else if (ddlRoleList.SelectedValue == "Agent")
            {
                AgentDetailsSql     agentDetailsSql = new AgentDetailsSql();
                List <AgentDetails> agentDetails    = agentDetailsSql.DisplayAgentDetails();
                var UserList = agentDetails.Where(x => x.UserName1 == txtUserName.Text && x.Password1 == txtpassword.Text).ToList();
                if (UserList.Count > 0)
                {
                    if (UserList[0].Isapproved1 != true)
                    {
                        lblMsg.Text = "Your Account is Pending for Admin Approval";
                    }
                    else
                    {
                        lblMsg.Text = "Login successfull";
                        Response.Redirect("~/Agent.aspx");
                    }
                }
                else
                {
                    lblMsg.Text = "Incorrect UserId/Password";
                    ClientScript.RegisterStartupScript(this.GetType(), "Popup", "successalert();", true);
                }
            }
            else
            {
                lblindex.Text = " Please Select the Role!!";
            }
        }