public CreationWindows(Save save) { this._isNew = true; this._creationVM = new CreationVM(save); this._creationVM.CreationUserControl = new CreationMemberUserControl(); DataContext = this._creationVM; this._isMember = true; InitializeComponent(); }
public ActionResult Create(CreationVM orderModel) { if (ModelState.IsValid) { db.Orders.Add(orderModel.order); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(orderModel)); }
// GET: Order/Create public ActionResult Create(int?id) { if (id == null || id == 0) { CreationVM view = new CreationVM(); view.contacts = db.Contacts.ToList(); return(View(view)); } CreationVM contact = new CreationVM(); contact.contact = db.Contacts.Find(id); return(View(contact)); }
public CreationWindows(Save save, People people, bool isMember) { this._isNew = false; this._creationVM = new CreationVM(save); InitializeComponent(); if (isMember) { Member member = people as Member; this._creationVM.CreationUserControl = new CreationMemberUserControl(member); TitleButton.Content = "Membre"; } else { IEmployee employee = people as IEmployee; this._creationVM.CreationUserControl = new CreationEmployeeUserControl(employee); TitleButton.Content = "SalariƩ"; } DataContext = this._creationVM; this._isMember = isMember; TitleButton.IsEnabled = false; }