private void CreateItem()
 {
     DataAccess da = new DataAccess();
     client item = new client();
     item.name = edtName.Text;
     item.description = edtDescr.Text;
     da.ClientCreate(item, cbCar.SelectedItem.ToString());
 }
示例#2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the clients EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToclients(client client)
 {
     base.AddObject("clients", client);
 }
示例#3
0
 /// <summary>
 /// Create a new client object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 public static client Createclient(global::System.Int32 id, global::System.String name)
 {
     client client = new client();
     client.id = id;
     client.name = name;
     return client;
 }
示例#4
0
 public void ClientEdit(client item, string carMarkName)
 {
     client original = objDataContext.clients.FirstOrDefault(b => b.id == item.id);
     original.car_mark = objDataContext.car_mark.FirstOrDefault(c => c.name == carMarkName);
     original.name = item.name;
     original.description = item.description;
     objDataContext.SaveChanges();
 }
示例#5
0
 public void ClientEdit(client item)
 {
     client original = objDataContext.clients.FirstOrDefault(b => b.id == item.id);
     original.name = item.name;
     original.description = item.description;
     objDataContext.SaveChanges();
 }
示例#6
0
 public void ClientCreate(client _obj, string carMarkName)
 {
     _obj.car_mark = objDataContext.car_mark.FirstOrDefault(c => c.name == carMarkName);
     objDataContext.AddToclients(_obj);
     objDataContext.SaveChanges();
 }
示例#7
0
 public void ClientCreate(client _obj)
 {
     //_obj.created_on = DateTime.Now;
     objDataContext.AddToclients(_obj);
     objDataContext.SaveChanges();
 }