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(); } }
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")); } }