Example #1
0
 private void Update_Customers(object sender = null, RoutedEventArgs e = null)
 {
     customers = curentSession.GetAllItems <GroupCustomers>(Request.comGetCustomers);
     icCustomers.ItemsSource    = customers.customers;
     cbxCustomers.ItemsSource   = customers.customers;
     grCustomerInfo.DataContext = null;
 }
        public ActionResult DeleteConfirmed(int id)
        {
            GroupCustomers groupCustomers = db.GroupCustomers.Find(id);

            db.GroupCustomers.Remove(groupCustomers);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "GroupCustomer_ID,GroupCustomer_CustomerID,GroupCustomer_GroupID,GroupCustomer_payingCost")] GroupCustomers groupCustomers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(groupCustomers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GroupCustomer_CustomerID = new SelectList(db.Customers, "ID", "Customer_EngName", groupCustomers.GroupCustomer_CustomerID);
     ViewBag.GroupCustomer_GroupID    = new SelectList(db.Groups, "Group_ID", "Group_CreationUser", groupCustomers.GroupCustomer_GroupID);
     return(View(groupCustomers));
 }
        // GET: GroupCustomers/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GroupCustomers groupCustomers = db.GroupCustomers.Find(id);

            if (groupCustomers == null)
            {
                return(HttpNotFound());
            }
            return(View(groupCustomers));
        }
        // GET: GroupCustomers/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GroupCustomers groupCustomers = db.GroupCustomers.Find(id);

            if (groupCustomers == null)
            {
                return(HttpNotFound());
            }
            ViewBag.GroupCustomer_CustomerID = new SelectList(db.Customers, "ID", "Customer_EngName", groupCustomers.GroupCustomer_CustomerID);
            ViewBag.GroupCustomer_GroupID    = new SelectList(db.Groups, "Group_ID", "Group_CreationUser", groupCustomers.GroupCustomer_GroupID);
            return(View(groupCustomers));
        }