/// <summary> /// Content Dialog Save Click event /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { newSub = new Subject(txtFirstName.Text, txtLastName.Text); newSub.image = imgTemp; newSub.setImage(bitmapImage); using (var db = new DataModel.UberEversolContext()) { db.Subjects.Add(newSub); db.SaveChanges(); } result = cdResult.AddSuccess; FlyoutBase.SetAttachedFlyout(this, (FlyoutBase)this.Resources["notifyFlyout"]); FlyoutBase.ShowAttachedFlyout(this); FlyoutBase.GetAttachedFlyout(this).Hide(); }
/// <summary> /// Save button click event /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { Session newSes = new Session(txtTitle.Text, txtDescription.Text); TimeSpan timeVal = dtSessionTime.Time; newSes.created = dtSessionDate.Date.Date + timeVal; using (var db = new UberEversolContext()) { db.Sessions.Add(newSes); db.SaveChanges(); } result = cdResult.AddSuccess; FlyoutBase.SetAttachedFlyout(this, (FlyoutBase)this.Resources["notifyFlyout"]); FlyoutBase.ShowAttachedFlyout(this); FlyoutBase.GetAttachedFlyout(this).Hide(); }
// Click event for the save button private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { //Copy the values entered selSession.title = txtTitle.Text; selSession.description = txtDescription.Text; selSession.folderDir = txtFolder.Text; DateTime dtTemp = new DateTime(dtDate.Date.Year, dtDate.Date.Month, dtDate.Date.Day, dtSessionTime.Time.Hours, dtSessionTime.Time.Minutes, 0); selSession.created = dtTemp; int res = selSession.DBUpdate(); // Update the data if (res == 0) { result = cdResult.UpdateSuccess; } else { result = cdResult.UpdateFail; } }
/// <summary> /// Content Dialog Cancel Click Event /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { result = cdResult.AddCancel; this.Hide(); //FlyoutBase.GetAttachedFlyout(this).Hide(); }
// Click event for the cancel button private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { result = cdResult.UpdateCancel; }
/// <summary> /// Cancel button click event /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { result = cdResult.AddCancel; this.Hide(); }