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()); }
/// <summary> /// Deprecated Method for adding a new object to the clients EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToclients(client client) { base.AddObject("clients", client); }
/// <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; }
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(); }
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(); }
public void ClientCreate(client _obj, string carMarkName) { _obj.car_mark = objDataContext.car_mark.FirstOrDefault(c => c.name == carMarkName); objDataContext.AddToclients(_obj); objDataContext.SaveChanges(); }
public void ClientCreate(client _obj) { //_obj.created_on = DateTime.Now; objDataContext.AddToclients(_obj); objDataContext.SaveChanges(); }