Ejemplo n.º 1
0
 public bool OrderRenew(OrderDetails p2, string a, string b, string c, string d)
 {
     using (var db = new Orderdb())
     {
         try
         {
             p2.ordernum     = a;
             p2.goodname     = b;
             p2.customername = c;
             p2.ordervalue   = d;
             db.Entry <OrderDetails>(p2).State = System.Data.Entity.EntityState.Modified;
             db.SaveChanges();
             return(true);
         }
         catch { return(false); }
     }
 }
Ejemplo n.º 2
0
        public bool Orderdelete(List <OrderService> order, string a)
        {
            using (var db = new Orderdb())
            {
                try
                {
                    var n = from OrderDetails god in order
                            where god.ordernum == a
                            select god;

                    foreach (var m in n)
                    {
                        db.Entry <OrderDetails>(m).State = System.Data.Entity.EntityState.Deleted;
                        db.SaveChanges();
                    }
                    return(true);
                }
                catch { return(false); }
            }
        }