Ejemplo 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);
            }
        }
Ejemplo n.º 2
0
 public shipment GetShipment(int id)
 {
     try
     {
         using (etvffqgz_megastoreEntities db = new etvffqgz_megastoreEntities())
         {
             shipment ship = db.shipments.Find(id);
             return(ship);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Ejemplo n.º 3
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);
            }
        }