/// <summary>
        /// Create a new ORDERDETAILS object.
        /// </summary>
        /// <param name="oRDERID">Initial value of the ORDERID property.</param>
        /// <param name="pRODUS">Initial value of the PRODUS property.</param>
        /// <param name="vALOARE">Initial value of the VALOARE property.</param>
        /// <param name="sERIAL">Initial value of the SERIAL property.</param>
        public static ORDERDETAILS CreateORDERDETAILS(global::System.Int16 oRDERID, global::System.String pRODUS, global::System.Decimal vALOARE, global::System.Int16 sERIAL)
        {
            ORDERDETAILS oRDERDETAILS = new ORDERDETAILS();

            oRDERDETAILS.ORDERID = oRDERID;
            oRDERDETAILS.PRODUS  = pRODUS;
            oRDERDETAILS.VALOARE = vALOARE;
            oRDERDETAILS.SERIAL  = sERIAL;
            return(oRDERDETAILS);
        }
Beispiel #2
0
        public bool updateOrderDetails(Int16 orderId, string produs, Decimal valoare, Int16 serial)
        {
            bool update = false;

            using (var testEntities = new TestEntities())
            {
                ORDERDETAILS orderD = new ORDERDETAILS();
                orderD.ORDERID = orderId;
                orderD.SERIAL  = serial;
                var order2 = testEntities.ORDERDETAILS.First(o => (o.ORDERID == orderD.ORDERID && o.SERIAL == orderD.SERIAL));
                order2.PRODUS  = produs;
                order2.VALOARE = valoare;
                testEntities.SaveChanges();
                update = true;
            }
            return(update);
        }
Beispiel #3
0
 public bool addOrderDetails(Int16 orderId, string produs, Decimal valoare, Int16 serial)
 {
     using (var testEntities = new TestEntities())
     {
         ORDERDETAILS orderD = new ORDERDETAILS();
         orderD.ORDERID = orderId;
         orderD.SERIAL  = serial;
         if (testEntities.ORDERDETAILS.Where(x => (x.ORDERID == orderD.ORDERID || x.SERIAL == orderD.SERIAL)).Count() <= 0)
         {
             orderD.PRODUS  = produs;
             orderD.VALOARE = valoare;
             testEntities.AddToORDERDETAILS(orderD);
             testEntities.SaveChanges();
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the ORDERDETAILS EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToORDERDETAILS(ORDERDETAILS oRDERDETAILS)
 {
     base.AddObject("ORDERDETAILS", oRDERDETAILS);
 }