/// <summary>
 /// Create a new CUSTOMER object.
 /// </summary>
 /// <param name="cUSTOMERID">Initial value of the CUSTOMERID property.</param>
 /// <param name="nAME">Initial value of the NAME property.</param>
 public static CUSTOMER CreateCUSTOMER(global::System.Int16 cUSTOMERID, global::System.String nAME)
 {
     CUSTOMER cUSTOMER = new CUSTOMER();
     cUSTOMER.CUSTOMERID = cUSTOMERID;
     cUSTOMER.NAME = nAME;
     return cUSTOMER;
 }
Beispiel #2
0
 //insert c
 private void button2_Click(object sender, EventArgs e)
 {
     CUSTOMER addc = new CUSTOMER();
     addc.CUSTOMERID = Convert.ToInt16(context.CUSTOMERs.ToList().Last().CUSTOMERID + 1);
     addc.NAME = textcname.Text;
     addc.ADRESA = textcadresa.Text;
     context.AddToCUSTOMERs(addc);
     int rowsAffected = context.SaveChanges(false);
     textCh.Text=rowsAffected.ToString() + " changes made to the customers (insert)";
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the CUSTOMERs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCUSTOMERs(CUSTOMER cUSTOMER)
 {
     base.AddObject("CUSTOMERs", cUSTOMER);
 }