Exemplo n.º 1
0
 public CreationWindows(Save save)
 {
     this._isNew      = true;
     this._creationVM = new CreationVM(save);
     this._creationVM.CreationUserControl = new CreationMemberUserControl();
     DataContext    = this._creationVM;
     this._isMember = true;
     InitializeComponent();
 }
Exemplo n.º 2
0
        public ActionResult Create(CreationVM orderModel)
        {
            if (ModelState.IsValid)
            {
                db.Orders.Add(orderModel.order);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(orderModel));
        }
Exemplo n.º 3
0
        // 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));
        }
Exemplo n.º 4
0
 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;
 }