public void UpdateStay() { try { using (ShelterDatabaseLINQDataContext db = new ShelterDatabaseLINQDataContext()) { Stays stay = db.Stays.FirstOrDefault(i => i.Id == ID); stay.StartDate = StartDate; stay.FinishDate = FinishDate; stay.Note = Note; stay.Adopted = Adopted; stay.Escaped = Escaped; stay.Died = Died; stay.FindDate = FindDate; stay.FindPlace = FindPlace; db.SubmitChanges(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void SaveStay() { try { using (ShelterDatabaseLINQDataContext db = new ShelterDatabaseLINQDataContext()) { Stays stay = new Stays { AnimalID = AnimalID, StartDate = StartDate, FinishDate = FinishDate, Note = Note, FindDate = FindDate, FindPlace = FindPlace, Adopted = Adopted, Escaped = Escaped, Died = Died }; db.Stays.InsertOnSubmit(stay); db.SubmitChanges(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void ExportPDF() { if (Stays != null && Stays.Count() != 0) { DocumentManager.ExportDataPDF(StayInfo.ConvertToList(Stays), "Export zvířata"); } else { MessageBox.Show("Žádná data pro export."); } }
public void SetInformations(Stays stay) { StartDate = stay.StartDate; FinishDate = stay.FinishDate; AnimalID = stay.AnimalID; Note = stay.Note; Adopted = stay.Adopted; Escaped = stay.Escaped; Died = stay.Died; FindPlace = stay.FindPlace; FindDate = stay.FindDate; }