private warehouse getItemFromFields() { warehouse item = new warehouse(); item.id = this._id; item.name = edtName.Text; item.description = edtDescr.Text; return item; }
private void LoadWarehouses() { DataAccess da = new DataAccess(); List<warehouse> l = da.GetWarehouses(); warehouse w = new warehouse(); w.name = "Все склады"; l.Add(w); edtWarehouse.DataContext = l; edtWarehouse.SelectedItem = w; }
/// <summary> /// Create a new warehouse object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> public static warehouse Createwarehouse(global::System.Int32 id, global::System.String name) { warehouse warehouse = new warehouse(); warehouse.id = id; warehouse.name = name; return warehouse; }
/// <summary> /// Deprecated Method for adding a new object to the warehouses EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTowarehouses(warehouse warehouse) { base.AddObject("warehouses", warehouse); }
public void WarehouseEdit(warehouse item) { warehouse original = objDataContext.warehouses.FirstOrDefault(b => b.id == item.id); if (original != null) { original.name = item.name; original.description = item.description; //if (original.created_on == null) // original.created_on = DateTime.Now; objDataContext.SaveChanges(); } }
public void WarehouseCreate(warehouse _obj) { //_obj.created_on = DateTime.Now; objDataContext.AddTowarehouses(_obj); objDataContext.SaveChanges(); }