Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Account a = new Account();

            a = (Account)Session["Account"];

            if (a == null)
            {
                Response.Redirect("LoginPage.aspx");
            }
            facilityName = Request.QueryString["q"];
            DateTextBox.Attributes.Add("readonly", "readonly");//prevents textbox from losing text after postback
            if (!IsPostBack)
            {
                //set namedropdownlist names

                //set hospitaldropdownlist
                HospitalDropDownList.DataSource     = FacilityManagementSystem.GetAllfacility();
                HospitalDropDownList.DataTextField  = "facility_Name";
                HospitalDropDownList.DataValueField = "facility_ID";
                HospitalDropDownList.DataBind();

                HospitalDropDownList.Items.Insert(0, new ListItem("-Select a Hospital-", "-1"));//add blank space at top of droplist
                if (facilityName != null)
                {
                    HospitalDropDownList.Items.FindByText(facilityName).Selected = true;
                    HospitalDropDownList_SelectedIndexChanged(null, null);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Account a = new Account();

            a = (Account)Session["Account"];

            if (a == null)
            {
                Response.Redirect("LoginPage.aspx");
            }
            if (!a.accountType.Equals("admin"))
            {
                Response.Redirect("LoginPage.aspx");
            }
            if (!IsPostBack)
            {
                int id = Int32.Parse((string)Session["doc_id"]);

                a = AccountManagementSystem.GetAccount(id);
                txtNric.Attributes.Add("placeholder", a.nric);
                txtName.Attributes.Add("placeholder", a.name);
                txtPassword.Attributes.Add("placeholder", a.password);
                txtEmail.Attributes.Add("placeholder", a.email);
                txtAddress.Attributes.Add("placeholder", a.address);

                Department D = new Department();
                D = DepartmentManagementSystem.GetDepartmentByUserID(id);


                Facility F = new Facility();
                F = FacilityManagementSystem.GetFacility(D.facilityId);

                FacilityDropDownList.DataSource = FacilityManagementSystem.GetAllfacility();
                FacilityDropDownList.DataBind();

                FacilityDropDownList.SelectedValue = F.facilityID.ToString();


                DepartmentDropDownList.DataSource = DepartmentManagementSystem.getDepartmentsFromThisFacility(FacilityDropDownList.SelectedItem.Value);
                DepartmentDropDownList.DataBind();


                DepartmentDropDownList.SelectedValue = D.departmentID.ToString();
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Account a = new Account();

            a = (Account)Session["Account"];

            if (a == null)
            {
                Response.Redirect("LoginPage.aspx");
            }
            if (!a.accountType.Equals("admin"))
            {
                Response.Redirect("LoginPage.aspx");
            }
            if (!IsPostBack)
            {
                FacilityDropDownList.DataSource = FacilityManagementSystem.GetAllfacility();
                FacilityDropDownList.DataBind();
                FacilityDropDownList.Items.Insert(0, new ListItem("- Select faciliy -", "-1"));
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Account a = new Account();

            a = (Account)Session["Account"];

            if (a == null)
            {
                Response.Redirect("LoginPage.aspx");
            }
            if (!a.accountType.Equals("Doctor"))
            {
                Response.Redirect("LoginPage.aspx");
            }
            if (Session["nric"] == null)
            {
                Response.Redirect("DoctorAppointmentPage.aspx");
            }
            DateTextBox.Attributes.Add("readonly", "readonly");//prevents textbox from losing text after postback
            if (!IsPostBack)
            {
                //set namedropdownlist names

                string nric = Session["nric"].ToString();

                a            = AccountManagementSystem.getAccountViaNRIC(nric);
                lb_name.Text = a.name;
                lb_id.Text   = a.accountID.ToString();

                //set hospitaldropdownlist
                HospitalDropDownList.DataSource     = FacilityManagementSystem.GetAllfacility();
                HospitalDropDownList.DataTextField  = "facility_name";
                HospitalDropDownList.DataValueField = "facility_id";
                HospitalDropDownList.DataBind();

                HospitalDropDownList.Items.Insert(0, new ListItem("-Select a Hospital-", "-1"));//add blank space at top of droplist
            }
        }