private void Fill() { WareUnitsLogic units = new WareUnitsLogic(manager); if (mode == "edit") { WareUnit unit = units.Get(Convert.ToInt32(id)); if (unit != null) { NameTB.Text = unit.Name; } } }