protected void Page_Load(object sender, EventArgs e) { if (Session["UserId"] == null) { Response.Redirect("Login.aspx"); } if (!Page.IsPostBack) { SlotService.SlotServiceClient client = new SlotService.SlotServiceClient(); String[] section = client.available_section(); DropDownList1.Items.Add("--- Select section ---"); DropDownList2.Items.Add("--- Available floors ---"); DropDownList3.Items.Add("--- Type of Vehicles ---"); foreach (string i in section) { DropDownList1.Items.Add(i); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserId"] == null || Session["UserName"].ToString() != "admin") { Response.Redirect("Login.aspx"); } if (!Page.IsPostBack) { SlotService.SlotServiceClient client1 = new SlotService.SlotServiceClient(); String[] section = client1.available_section(); DropDownList5.Items.Add("--- Select section ---"); DropDownList2.Items.Add("--- Available floors ---"); DropDownList4.Items.Add("--- Type of Vehicles ---"); foreach (string i in section) { DropDownList5.Items.Add(i); } } Response.Write("<br /><h1 style='text-align:center; color:#dcdcdc;font-size:35px;'>ADMIN PANEL</h1>"); SlotService.SlotServiceClient client = new SlotService.SlotServiceClient(); String[] sections = client.available_section(); Response.Write("<div style='float:left;margin:1% 8% 0% 12%'><table border='1' style='border-collapse: collapse;background:#dcdcdc;'><th style='text-align:center;font-size:24px;padding:10px;' colspan='2' >SLOT DETAILS</th>"); foreach (string i in sections) { int[] floor = client.available_floor(i); Response.Write("<tr><td colspan='2' style='text-align:center;font-size:19px;padding:10px;'>SECTION : " + i + "</td></tr>"); foreach (int j in floor) { string[] type = client.available_type(i, j); Response.Write("<tr><td rowspan = '" + type.Length + "' style='font-size:16px;padding:8px 22px'>Floor : " + j + "</td>"); foreach (string z in type) { int count = client.showAllSlots(i, j, z); Response.Write("<td style='font-size:16px;padding:8px 22px'>" + z + " : " + count + "</td></tr>"); } } } Response.Write("</table></div>"); }