private void addButton_Click(object sender, EventArgs e) { var member_number = memberTextBox.Text; //var id = idTextBox.Text; Rental model = new Rental { Member_Number = int.Parse(member_number) }; bool success = RentalDAL.addrental(model); // MessageBox.Show("Genre successfully added."); // MESSAGE BOX HERE DEPENDENT ON SUCCESS }
public static bool AddRental(RentalDTO rd) { Rental r = RentalDTO.ToDal(rd); int id = RentalDAL.AddRental(r); if (id != 0) { if (rd.Dock != null) { Document doc = new Document(); doc.DocCoding = rd.Dock; doc.DocUser = id; doc.type = 3; doc.DocName = rd.DocName; DocumentBL.AddUserDocuments(new DocumentDTO(doc)); } if (rd.ContactRenew == true && (rd.EndDate).Value < DateTime.Today.AddMonths(3)) { Bl.TaskBL.AddRenewTask(rd.PropertyID, rd.SubPropertyID); } return(true); } return(false); }
private void findButton_Click(object sender, EventArgs e) { Member_Number = int.Parse(memberTextBox.Text); RentalDAL.searchrental(Member_Number.ToString()); }
public static List <RentalDTO> Search(Nullable <int> propertyID, string owner, string user, Nullable <DateTime> enteryDate, Nullable <DateTime> endDate) { List <Rental> rentals = RentalDAL.Search(propertyID, owner, user, enteryDate, endDate); return(ConvertListToDTO(rentals)); }