Esempio n. 1
0
        public String CreateShipment(shipment ship)
        {
            try
            {
                etvffqgz_megastoreEntities db = new etvffqgz_megastoreEntities();
                db.shipments.Add(ship);
                db.SaveChanges();
                return("Order successful by: " + ship.customer_customer_email);
            }

            catch (Exception e)
            {
                return("Error:" + e);
            }
        }
Esempio n. 2
0
        public string AddAdmin(admin admin)
        {
            try
            {
                etvffqgz_megastoreEntities db = new etvffqgz_megastoreEntities();
                db.admins.Add(admin);
                db.SaveChanges();
                return(admin.email + " was successfully added");
            }

            catch (Exception e)
            {
                return("Error:" + e);
            }
        }
Esempio n. 3
0
        public string RemoveAdmin(string email)
        {
            try
            {
                etvffqgz_megastoreEntities db = new etvffqgz_megastoreEntities();
                admin p = db.admins.Find(email);
                db.admins.Attach(p);
                db.admins.Remove(p);
                db.SaveChanges();
                return(p.email + " was successfully deleted");
            }

            catch (Exception e)
            {
                return("Error:" + e);
            }
        }
Esempio n. 4
0
        public String DeleteShipment(int id)
        {
            try
            {
                etvffqgz_megastoreEntities db = new etvffqgz_megastoreEntities();
                shipment p = db.shipments.Find(id);
                db.shipments.Attach(p);
                db.shipments.Remove(p);
                db.SaveChanges();
                return(p.shipment_id + " was successfully deleted");
            }

            catch (Exception e)
            {
                return("Error:" + e);
            }
        }