Esempio n. 1
0
        private void btnSaveChanges_Click(object sender, EventArgs e)
        {
            string ErrorMsg;

            if (!changed)
            {
                lblAnyText.Text = "Can't save, nothing has changed.";
                return;
            }
            var errors = ValidateFields();

            if (errors != "")
            {
                ErrorMsg        = "Can't save, errors: " + errors;
                lblAnyText.Text = ErrorMsg;
                return;
            }

            entry.SetImage(openFileDialog1.FileName);

            DatabaseClass.UpdateEntries(category, entry.name, txtEntryName.Text, Int32.Parse(drpdRating.SelectedItem.ToString()), txtEntryDescription.Text,
                                        dateRelease.Value.ToShortDateString(), Int32.Parse(txtWatchCount.Text), entry.image);

            this.Close();
            this.Dispose();
        }
Esempio n. 2
0
 private void ChildForm_Leave(object sender, EventArgs e)
 {
     if (type == ChildFormType.Category)
     {
         foreach (EntryComponent entry in entryComponents)
         {
             Entry cons = entry.entry;
             DatabaseClass.UpdateEntries(category,
                                         cons.name, cons.name, cons.score, cons.description,
                                         cons.date, cons.watchCount, cons.image);
             entry.DestroyComponent();
         }
         btnAddEntry.Image.Dispose();
         btnSearch.BackgroundImage.Dispose();
         this.Dispose(true);
         this.Close();
     }
 }