public Lab(int id, string name) { this.id = id; this.name = name; workStations = new List<WorkStation>(); schedule = new Schedule(); }
protected void gvResults_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit") { int index = Convert.ToInt32(e.CommandArgument); int i = (int)GridView1.DataKeys[index].Value; shift = dataShift.readShiftEDITBusy(i); Session["shiftSession"] = shift; schedule = dataSchedule.readScheduleEDIT(shift.Id, DropDownList1.SelectedValue, DropDownList2.SelectedValue); Session["scheduleSession"] = schedule; dataShift.updateShift(dataShift.readLabEDIT(DropDownList1.SelectedValue), schedule.Busy, shift.Id, dataDate.readDateEDIT(DropDownList2.SelectedValue)); Response.Redirect("/CRUDShift.aspx"); } }
public Schedule readScheduleEDIT(int id, string nameLab, string date) { Schedule schedule = new Schedule(); SqlConnection con = DatabaseConnection("open"); SqlCommand cmd = new SqlCommand("readScheduleEdit", con); cmd.Parameters.AddWithValue("@id", id); cmd.Parameters.AddWithValue("@nameLab", nameLab); cmd.Parameters.AddWithValue("@nameDay", date); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.ExecuteNonQuery(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { schedule.Busy = reader.GetBoolean(reader.GetOrdinal("busy")); } cmd.Dispose(); DatabaseConnection("close"); return schedule; }
public void updateSchedule(Schedule schedule) { }