private void createDepot() { if (this.DepotTxt.Text != "") { foreach (DataRow row in Bodega.GetDepots().Rows) { if (row["Nombre"].ToString().ToLower() == this.DepotTxt.Text.ToLower()) { MessageBox.Show("Ya existe una bodega con este nombre."); this.DepotTxt.Text += " Nuevo"; this.DepotTxt.Select(); return; } } Bodega bodega = new Bodega(Bodega.newDepot(this.DepotTxt.Text)); this.DialogResult = DialogResult.OK; this.Close(); } else if (this.DepotLbl.Visible) { this.errorProvider1.SetError(DepotLbl, "Ingrese el nombre de la bodega"); } else { this.DepotTxt.HintForeColor = Color.Tomato; this.DepotTxt.LineIdleColor = Color.Tomato; } }
public Panel_productos_Transferir_Inventario_entre_bodegas(Producto product) { this.InitializeComponent(); this.DialogResult = DialogResult.Cancel; this.transferCount = 0; this.altered = false; this.product = product; this.ReceiverDepotIDs = new List <int>(); this.DonatingComboDepotsIds = new List <int>(); foreach (DataRow row in Bodega.GetDepots().Rows) { this.receiverCombo.Items.Add(row["Nombre"]); this.ReceiverDepotIDs.Add(Convert.ToInt32(row["ID_Bodega"])); } this.receiverCombo.SelectedItem = new Bodega(product.defaultDepotID).name; this.receiverDepot = new Bodega(product.defaultDepotID); this.setReceiverDepotCard(); ProductTxt.Select(); }
private void getDepots() { DataTable depots = Bodega.GetDepots(); this.depotID = new int[depots.Rows.Count]; for (int index = 0; index < depots.Rows.Count; ++index) { DataRow row = depots.Rows[index]; this.comboBox1.Items.Add(row["Nombre"]); this.depotID[index] = Convert.ToInt32(row["ID_Bodega"]); } this.comboBox1.SelectedIndex = 0; }
public static int newDepot(string name) { if (!(name != "")) { return(-1); } foreach (DataRow row in Bodega.GetDepots().Rows) { if (row["Nombre"].ToString().ToLower() == name.ToLower()) { MessageBox.Show("No se creó la bodega."); return(-1); } } return(new Capa_de_Negocio().DepotNewDepot(name)); }
private void editDepot() { foreach (DataRow row in (InternalDataCollectionBase)Bodega.GetDepots().Rows) { if (row["Nombre"].ToString().ToLower() == this.DepotTxt.Text.ToLower() && this.depot.ID != Convert.ToInt32(row["ID_Bodega"])) { MessageBox.Show("Ya existe una bodega con este nombre."); this.DepotTxt.Text += " Nuevo"; this.DepotTxt.Select(); return; } } if (this.DepotTxt.Text.ToLower() != this.depot.name.ToLower()) { this.depot.name = this.DepotTxt.Text; this.depot.Rename(); } }
public PanelProducto_Scrap() { this.InitializeComponent(); this.ShowInTaskbar = false; this.product = (Producto)null; this.depot = (Bodega)null; this.Size = this.minimized; this.scrapCount = 0.0; this.depotList = new Dictionary <string, int>(); foreach (DataRow row in (InternalDataCollectionBase)Bodega.GetDepots().Rows) { this.comboBox1.Items.Add((object)row["Nombre"].ToString()); this.depotList.Add(row["Nombre"].ToString(), Convert.ToInt32(row["ID_Bodega"])); } textBox1.SelectAll(); this.comboBox1.SelectedIndex = 0; this.depot = new Bodega(1); this.Refresh(); }