protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); if (!IsPostBack) { DataRow dr = dbGetEvent(Request.QueryString["id"]); if (dr == null) { throw new Exception("The event was not found"); } TextBoxStart.Text = Convert.ToDateTime(dr["ReservationStart"]).ToShortDateString(); TextBoxEnd.Text = Convert.ToDateTime(dr["ReservationEnd"]).ToShortDateString(); TextBoxStartTime.Text = dr["StartTime"] as string; TextBoxEndTime.Text = dr["EndTime"] as string; TextBoxName.Text = dr["ReservationName"] as string; TextBoxUser.Text = dr["UserName"] as string; DropDownListRoom.DataSource = dbGetResources(); DropDownListRoom.DataTextField = "RoomName"; DropDownListRoom.DataValueField = "RoomId"; DropDownListRoom.SelectedValue = Convert.ToString(dr["RoomId"]); DropDownListRoom.DataBind(); DropDownListStatus.SelectedValue = Convert.ToString(dr["ReservationStatus"]); DropDownListPaid.SelectedValue = Convert.ToString(dr["ReservationPaid"]); TextBoxName.Focus(); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); dr = Db.LoadAppointment(Convert.ToInt32(Request.QueryString["id"])); if (dr == null) { throw new Exception("The requested time slot was not found"); } if (!IsPostBack) { TextBoxStart.Text = Convert.ToDateTime(dr["AppointmentStart"]).ToString(); TextBoxEnd.Text = Convert.ToDateTime(dr["AppointmentEnd"]).ToString(); TextBoxName.Text = dr["AppointmentPatientName"] as string; DropDownListStatus.SelectedValue = (string)dr["AppointmentStatus"]; DropDownListRoom.DataSource = Db.LoadDoctors(); DropDownListRoom.DataTextField = "DoctorName"; DropDownListRoom.DataValueField = "DoctorId"; DropDownListRoom.SelectedValue = Convert.ToString(dr["DoctorId"]); DropDownListRoom.DataBind(); TextBoxName.Focus(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownListRoom.DataSource = getData("spGetRoomType", null); DropDownListRoom.DataBind(); ListItem LIRoomType = new ListItem("---Select---", "-1"); DropDownListRoom.Items.Insert(0, LIRoomType); DropDownListGH.DataSource = getData("spGetGuestHouse", null); DropDownListGH.DataBind(); ListItem LIGuestHouse = new ListItem("---Select---", "-1"); DropDownListGH.Items.Insert(0, LIGuestHouse); } }
protected void Page_Load(object sender, EventArgs e) { LoginUser user = Session["user"] as LoginUser; if (!(user.HasPrimaryRole("admin") || user.HasSecondaryRole("admin"))) { Response.Redirect("logout.aspx"); } if (!IsPostBack) { DropDownListRoom.DataSource = getData("spGetRoomType", null); DropDownListRoom.DataBind(); ListItem LIRoomType = new ListItem("---Select---", "-1"); DropDownListRoom.Items.Insert(0, LIRoomType); DropDownListGH.DataSource = getData("spGetGuestHouse", null); DropDownListGH.DataBind(); ListItem LIGuestHouse = new ListItem("---Select---", "-1"); DropDownListGH.Items.Insert(0, LIGuestHouse); } }
protected void DropDownListHall_SelectedIndexChanged(object sender, EventArgs e) { DropDownListRoom.DataBind(); Button1.Visible = true; }