Пример #1
0
        protected void btnDoctorSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                BALAccounts Bal = new BALAccounts();

                DoctorDetailsSql doctorDetailsSql = new DoctorDetailsSql();
                DoctorDetails    doctorDetails    = new DoctorDetails
                {
                    FirstName1         = txtDoctorFname.Text,
                    LastName1          = txtDoctorLname.Text,
                    Age1               = int.Parse(txtDoctorAge.Text),
                    Gender1            = ddlDoctorGender.Text,
                    DoB1               = txtDoctordob.Text,
                    ContactNumber1     = double.Parse(txtDoctorcntct.Text),
                    AltContactNumber1  = double.Parse(txtDoctorAltcntct.Text),
                    EmailID1           = txtDoctorEmail.Text,
                    UserName1          = txtDoctorUserName.Text,
                    Password1          = txtDoctorPasswd.Text,
                    AddressLine11      = txtDoctorAddress.Text,
                    AddressLine21      = txtDoctoraltAddress.Text,
                    City1              = txtDoctorcity.Text,
                    State1             = txtDoctorstate.Text,
                    Zipcode1           = int.Parse(txtDoctorZipcode.Text),
                    Degree1            = txtDoctorDegree.Text,
                    Specialty1         = txtDoctorSpeciality.Text,
                    Workhours1         = int.Parse(txtDoctorWorkhours.Text),
                    HospitalName1      = txtDoctorHspName.Text,
                    MedicareServiceID1 = int.Parse(txtDoctorMediServID.Text),
                    Isapproved1        = false
                };
                if (Bal.regdoctordetails(doctorDetails))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Popup", "regalert();", true);
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
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!!";
            }
        }