protected void Page_Load(object sender, EventArgs e) { ValidateEmployee val = new ValidateEmployee(); if (!val.IsEmployee(Context.User.Identity.Name)) { Response.Redirect("default.aspx"); } ControlLabel.Text = "Control"; //SQLConnector con = new SQLConnector(); //MovieDTO movie1 = new MovieDTO(); //con.CreateMovie(movie1); //MovieDTO movie3 = new MovieDTO() //{ // Description = "Description Only" //}; //con.CreateMovie(movie3); //MovieDTO movie4 = new MovieDTO() //{ // PosterFileName = "PosterFileName Only" //}; //con.CreateMovie(movie4); //MovieDTO movie5 = new MovieDTO() //{ // Price = 13.37M //}; //con.CreateMovie(movie5); }
protected void Page_Load(object sender, EventArgs e) { ValidateEmployee val = new ValidateEmployee(); if (!val.IsEmployee(Context.User.Identity.Name)) { Response.Redirect("default.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { ValidateEmployee val = new ValidateEmployee(); if (!val.IsEmployee(Context.User.Identity.Name)) { Response.Redirect("default.aspx"); } SQLConnector con = new SQLConnector(); List <ResourceScreeningDTO> lisResScre = new List <ResourceScreeningDTO>(); lisResScre = con.GetAll("ResourceScreening").Cast <ResourceScreeningDTO>().ToList(); //Lav table HtmlGenericControl table = new HtmlGenericControl("TABLE"); table.Attributes["class"] = "table table-hover"; BodyDiv.Controls.Add(table); //Lav header ResourceScreeningDTO dummy = new ResourceScreeningDTO(); TableRow HeaderRow = new TableRow(); foreach (PropertyInfo pi in dummy.GetType().GetProperties()) { TableCell HeaderCell = new TableCell { Text = pi.Name }; HeaderRow.Cells.Add(HeaderCell); } Reservation.Rows.Add(HeaderRow); foreach (ResourceScreeningDTO lisRow in lisResScre) { TableRow CurrentRow = new TableRow(); TableCell FirstCell = new TableCell { Text = lisRow.FirstName }; CurrentRow.Cells.Add(FirstCell); foreach (PropertyInfo pi in lisRow.GetType().GetProperties()) { if (pi.Name != "FirstName") { TableCell CurrentCell = new TableCell { Text = Convert.ToString(pi.GetValue(lisRow)) }; CurrentRow.Cells.Add(CurrentCell); } } Reservation.Rows.Add(CurrentRow); } }
protected void Page_Load(object sender, EventArgs e) { ValidateEmployee val = new ValidateEmployee(); if (!val.IsEmployee(Context.User.Identity.Name)) { Response.Redirect("default.aspx"); } //Create Dynamic drop down lists for Movie and Screening SQLConnector con = new SQLConnector(); if (!Page.IsPostBack) { List <MovieDTO> lisMovies = new List <MovieDTO>(); lisMovies = con.GetAll("Movie").Cast <MovieDTO>().ToList(); MovieDropDownList.DataTextField = "Title"; MovieDropDownList.DataValueField = "Id"; MovieDropDownList.DataSource = lisMovies; MovieDropDownList.DataBind(); List <TheaterDTO> lisTheaters = new List <TheaterDTO>(); lisTheaters = con.GetAll("Theater").Cast <TheaterDTO>().ToList(); TheaterDropDownList.DataTextField = "Name"; TheaterDropDownList.DataValueField = "Id"; TheaterDropDownList.DataSource = lisTheaters; TheaterDropDownList.DataBind(); TheaterDropDownList.SelectedIndex = 0; //Give Number Of Seats textbox value from DB matching the Theater selected in drop down. string SeatsTemp = string.Empty; SQLConnector sqlCon = new SQLConnector(); object obj = sqlCon.Get("Theater", Convert.ToInt32(TheaterDropDownList.Text)); foreach (PropertyInfo pi in obj.GetType().GetProperties()) { if (pi.Name == "NumberOfSeats") { SeatsTemp = Convert.ToString(pi.GetValue(obj)); InputSeats.Value = SeatsTemp; } } } }
public HttpResponseMessage ValidateEmployeeID([FromBody] ValidateEmployee request) { try { request.empid = "EITS" + request.empid; bool employeeExists = objAlexaAuthentication.ValidateEmployeeID(request.DeviceId, request.empid.ToUpper()); if (employeeExists) { var objusers = objAlexaAuthentication.FetchUserDetails(request.DeviceId); return(Request.CreateResponse(HttpStatusCode.OK, objusers)); } else { FetchUsers objusers = new FetchUsers(); objusers.status = 0; return(Request.CreateResponse(HttpStatusCode.OK, objusers)); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.InnerException.ToString())); } }