public void updateReservationTitle(eReservationTitle e) { tbl_ReservationTitle temp = db.tbl_ReservationTitles.Where(x => x.ReservationID == e.ReservationID).FirstOrDefault(); temp.ReservationID = e.ReservationID; temp.TitleID = e.TitleID; db.SubmitChanges(); }
public void insertReservationTitle(eReservationTitle e) { tbl_ReservationTitle temp = new tbl_ReservationTitle(); temp.ReservationID = e.ReservationID; temp.TitleID = e.TitleID; db.tbl_ReservationTitles.InsertOnSubmit(temp); db.SubmitChanges(); }
private void btnUpdate_Click(object sender, EventArgs e) { eReservationTitle temp = new eReservationTitle(); temp.ReservationID = Convert.ToInt32(txtReservationID.Text); temp.TitleID = Convert.ToInt32(txtTitleID.Text); rtbll.updateReservationTitle(temp); LoadDataGridView(dgvReservationTitle, rtbll.getAllRTbyReservationID(Convert.ToInt32(txtReservationID.Text))); }
private void btnadd_Click(object sender, EventArgs e) { eReservationTitle d = new eReservationTitle(); txtReservationID.Text = Reservationid.ToString(); d.ReservationID = Convert.ToInt32(txtReservationID.Text); d.TitleID = Convert.ToInt32(txtTitleID.Text); rtbll.insertReservationTitle(d); //diskrentalbll.ins(rental); LoadDataGridView(dgvReservationTitle, rtbll.getAllRTbyReservationID(Convert.ToInt32(txtReservationID.Text))); }
public List <eReservationTitle> getAllRTbyReservationID(int rid) { List <eReservationTitle> ls = new List <eReservationTitle>(); var list = db.tbl_ReservationTitles.Where(x => x.ReservationID == rid).ToList(); foreach (tbl_ReservationTitle item in list) { eReservationTitle temp = new eReservationTitle(); temp.ReservationID = item.ReservationID; temp.TitleID = item.TitleID; ls.Add(temp); } return(ls); }
public List <eReservationTitle> getAllReservationTitle() { List <eReservationTitle> ls = new List <eReservationTitle>(); foreach (tbl_ReservationTitle item in db.tbl_ReservationTitles.ToList()) { eReservationTitle temp = new eReservationTitle(); temp.ReservationID = item.ReservationID; temp.TitleID = item.TitleID; ls.Add(temp); } return(ls); }