private void DataGV_CellClick(object sender, DataGridViewCellEventArgs e) { if (DataGV.SelectedRows[0].Cells[e.ColumnIndex].OwningColumn.Name == "PricesC") { Wares.Price.PricesList form = new Wares.Price.PricesList(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); form.ShowDialog(); } if (DataGV.SelectedRows[0].Cells[e.ColumnIndex].OwningColumn.Name == "ComponentsC") { Wares.Ware.WareComponentDataSimple form = new Wares.Ware.WareComponentDataSimple("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); form.ShowDialog(); } if (DataGV.SelectedRows.Count > 0) { ComponentsTV.Nodes.Clear(); int wareId = Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value); WareComponentsLogic componentsLogic = new WareComponentsLogic(manager); List <WareComponent> components = componentsLogic.GetAllRecursively(wareId, null); foreach (WareComponent component in components) { ComponentsTV.Nodes.Add(component.WareID.ToString(), component.Ware1.Name + " " + component.UnitQuantity.ToString() + component.Ware1.WareUnit.Name); } } }
private void ComponentsSB_Click(object sender, EventArgs e) { Wares.Ware.WareComponentDataSimple form = new Wares.Ware.WareComponentDataSimple("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); form.MdiParent = this.MdiParent; form.Show(); //wareFilterUC1.Fill(); }
private void DataGV_CellClick(object sender, DataGridViewCellEventArgs e) { if (DataGV.SelectedRows[0].Cells[e.ColumnIndex].OwningColumn.Name == "PricesC") { Wares.Price.PricesList form = new Wares.Price.PricesList(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); form.ShowDialog(); } if (DataGV.SelectedRows[0].Cells[e.ColumnIndex].OwningColumn.Name == "ComponentsC") { Wares.Ware.WareComponentDataSimple form = new Wares.Ware.WareComponentDataSimple("edit", Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); form.ShowDialog(); } if (DataGV.SelectedRows.Count > 0) { ComponentsTV.Nodes.Clear(); int wareId = Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value); WareComponentsLogic componentsLogic = new WareComponentsLogic(manager); List<WareComponent> components = componentsLogic.GetAllRecursively(wareId, null); foreach (WareComponent component in components) { ComponentsTV.Nodes.Add(component.WareID.ToString(), component.Ware1.Name + " " + component.UnitQuantity.ToString() + component.Ware1.WareUnit.Name); } } }