/// <summary> /// Create a new ORDER object. /// </summary> /// <param name="oRDERID">Initial value of the ORDERID property.</param> /// <param name="dATA">Initial value of the DATA property.</param> /// <param name="cUSTOMERID">Initial value of the CUSTOMERID property.</param> public static ORDER CreateORDER(global::System.Int16 oRDERID, global::System.DateTime dATA, global::System.Int16 cUSTOMERID) { ORDER oRDER = new ORDER(); oRDER.ORDERID = oRDERID; oRDER.DATA = dATA; oRDER.CUSTOMERID = cUSTOMERID; return(oRDER); }
private void button_update_Click(object sender, EventArgs e) { try { using (var db = new TestContext()) { ORDER c = db.ORDERs.First(i => i.CUSTOMERID == Convert.ToInt16(this.textBox2.Text)); c.DATA = Convert.ToDateTime(this.textBox1.Text); c.VALOARE = Convert.ToDecimal(this.textBox3.Text); db.SaveChanges(); } } catch (Exception ex) { MessageBox.Show("Obiectul nu a putut fi updatat! " + ex.InnerException); } this.Close(); }
private void button1_Click(object sender, EventArgs e) { try { using (TestContext db = new TestContext()) { ORDER r = new ORDER { DATA = Convert.ToDateTime(this.textBox1.Text), CUSTOMERID = Convert.ToInt16(this.textBox2.Text), VALOARE = Convert.ToDecimal(this.textBox3.Text) }; db.ORDERs.AddObject(r); db.SaveChanges(); } } catch (Exception ex) { MessageBox.Show("Obiectul nu a putut fi adaugat! " + ex.InnerException); } this.Close(); }
/// <summary> /// Deprecated Method for adding a new object to the ORDERs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToORDERs(ORDER oRDER) { base.AddObject("ORDERs", oRDER); }