public void Clear(AddIns a) { a.txtInstrID.Text = ""; a.txtInstrName.Text = ""; a.txtInstrPhone.Text = ""; a.txtInstrEmail.Text = ""; a.txtInstrAddress.Text = ""; a.txtInstrAccountID.Text = ""; a.dpInstrBDate.SelectedDate = DateTime.Today; if (a.rbInstrGenderFM.IsChecked == true) { a.rbInstrGenderFM.IsChecked = false; } else { a.rbInstrGenderM.IsChecked = false; } if (a.rbInstrIsMngrNo.IsChecked == true) { a.rbInstrIsMngrNo.IsChecked = false; } else { a.rbInstrIsMngrYes.IsChecked = false; } }
public ClientOrder.OrderLine AsClientOrderLine() { var line = new ClientOrder.OrderLine(); line.DrinkId = API.Ordering.Domain.Drinks.DrinkId.From(DrinkId); line.DrinkSizeId = API.Ordering.Domain.Drinks.DrinkSizeId.From(SizeId); line.AddInIds = AddIns?.Select(AddInId.From).ToList() ?? new List <AddInId>(); line.Count = Count; return(line); }
private static AddIn FindAddin(AddIns addins) { foreach (AddIn addin in addins) { if (!string.IsNullOrEmpty(addin.Name) && addin.Name.Contains("OMAddin")) { return(addin); } } throw new InvalidOperationException(); }
public void AddInstructor(AddIns a) { if (a.txtInstrName.Text == "") { MessageBox.Show("Please Enter Instructor's Name"); Clear(a); } else if (!IsAllLetters(a.txtInstrName.Text)) { MessageBox.Show("Invalid Name, Enter Letters Only"); Clear(a); } if (a.rbInstrGenderFM.IsChecked == false && a.rbInstrGenderM.IsChecked == false) { MessageBox.Show("Select Instructor's Gender"); Clear(a); } if (a.dpInstrBDate.SelectedDate.Value == null) { MessageBox.Show("Choose a Birthdate"); Clear(a); } if (a.txtInstrEmail.Text == "") { MessageBox.Show("Enter Email Address"); Clear(a); } else if (!IsValidEmail(a.txtInstrEmail.Text)) { MessageBox.Show("Invalid Email Address"); Clear(a); } if (a.txtInstrPhone.Text == "") { MessageBox.Show("Enter Phone number"); Clear(a); } else if (!IsvalidPhone(a.txtInstrPhone.Text)) { MessageBox.Show("Invalid Phone Number"); Clear(a); } if (a.txtInstrAddress.Text == "") { MessageBox.Show("Enter Address"); Clear(a); } if (a.rbInstrIsMngrNo.IsChecked == false && a.rbInstrIsMngrYes.IsChecked == false) { MessageBox.Show("Is Manager Or Not?"); Clear(a); } else { string g; if (a.rbInstrGenderFM.IsChecked == true) { g = "Female"; } else { g = "Male"; } bool m; if (a.rbInstrIsMngrYes.IsChecked == true) { m = true; } else { m = false; } var ins = new Instructor { Name = a.txtInstrName.Text, Gender = g, Birthdate = a.dpInstrBDate.SelectedDate.Value, Email = a.txtInstrEmail.Text, // phone = txtInstrPhone.Text, // address = txtInstrAddress.Text, IsManager = m //accountID = int.Parse(txtInstrAccountID.Text) }; context.Instructor.Add(ins); context.SaveChanges(); MessageBox.Show("Successfully Added"); } }
public void updateInstructor(AddIns a) { if (a.txtInstrName.Text == "") { MessageBox.Show("Please Enter Instructor's Name"); Clear(a); } else if (!IsAllLetters(a.txtInstrName.Text)) { MessageBox.Show("Invalid Name, Enter Letters Only"); Clear(a); } if (a.rbInstrGenderFM.IsChecked == false && a.rbInstrGenderM.IsChecked == false) { MessageBox.Show("Select Instructor's Gender"); Clear(a); } if (a.dpInstrBDate.SelectedDate.Value == null) { MessageBox.Show("Choose a Birthdate"); Clear(a); } if (a.txtInstrEmail.Text == "") { MessageBox.Show("Enter Email Address"); Clear(a); } else if (!IsValidEmail(a.txtInstrEmail.Text)) { MessageBox.Show("Invalid Email Address"); Clear(a); } if (a.txtInstrPhone.Text == "") { MessageBox.Show("Enter Phone number"); Clear(a); } else if (!IsvalidPhone(a.txtInstrPhone.Text)) { MessageBox.Show("Invalid Phone Number"); Clear(a); } if (a.txtInstrAddress.Text == "") { MessageBox.Show("Enter Address"); Clear(a); } if (a.rbInstrIsMngrNo.IsChecked == false && a.rbInstrIsMngrYes.IsChecked == false) { MessageBox.Show("Is Manager Or Not?"); Clear(a); } else { string g; if (a.rbInstrGenderFM.IsChecked == true) { g = "Female"; } else { g = "male"; } bool m; if (a.rbInstrIsMngrYes.IsChecked == true) { m = true; } else { m = false; } int ID = int.Parse(a.txtInstrID.Text); var ins = (from I in context.Instructor where I.ID == ID select I).FirstOrDefault(); ins.ID = int.Parse(a.txtInstrID.Text); ins.Name = a.txtInstrName.Text; ins.Gender = g; //ins.birthdate = dpInstrBDate.SelectedDate.Value; ins.Email = a.txtInstrEmail.Text; // ins.phone = txtInstrPhone.Text; // ins.address = txtInstrAddress.Text; ins.IsManager = m; //accountID = int.Parse(txtInstrAccountID.Text) } context.SaveChanges(); MessageBox.Show("Successfully Edited"); }
public AddInNodeCollectionFactory(AddIns addIns) { _addIns = addIns; }
public AddInNodeCollectionFactory(AddIns addIns) { _addIns = addIns; }
private void MainMap_MapElementPointerExited(MapControl sender, MapElementPointerExitedEventArgs args) { AddIns.FirstOrDefault(addin => addin.MapElementsShown.Contains(args.MapElement))?.OnMapElementPointerExited(args.MapElement, args.Location.ToLatLon(), args.Position); }