private void button1_Click(object sender, EventArgs e) { if (MessageBox.Show("¿Está seguro de modificar?", "Modificación", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { if (textBox10.Text == "" | textBox11.Text == "" | textBox12.Text == "" | textBox13.Text == "" | textBox14.Text == "") { MessageBox.Show("Ingrese la informacion correctamente"); } else { ClassColores Logica = new ClassColores(); MODELS.Cliente claseCliente = new MODELS.Cliente(); claseCliente.ClienteId = Convert.ToInt32(this.dataGridView3.CurrentRow.Cells[0].Value.ToString());; claseCliente.Nombre = textBox10.Text; claseCliente.Apellido = textBox11.Text; claseCliente.NIT = textBox12.Text; claseCliente.DPI = textBox13.Text; claseCliente.Telefono = textBox14.Text; string resp = Logica.ActualizarCliente(claseCliente); MessageBox.Show(resp); MostrarDatos(); textBox10.Text = ""; textBox11.Text = ""; textBox12.Text = ""; textBox13.Text = ""; textBox14.Text = ""; } } }
private void btnModCat_Click(object sender, EventArgs e) { if (MessageBox.Show("¿Está seguro de modificar?", "Modificación", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { if (textBox1.Text == "") { MessageBox.Show("Ingrese la informacion correctamente"); } else { ClassColores Logica = new ClassColores(); MODELS.Categoria claseCategoria = new MODELS.Categoria(); int codigo = 0; claseCategoria.CategoriaId = Convert.ToInt32(this.dataGridView1.CurrentRow.Cells[0].Value.ToString()); claseCategoria.Nombre = textBox1.Text; string resp = Logica.ActualizarCategoria(claseCategoria); MessageBox.Show(resp); textBox1.Text = ""; MostrarDatos(); btnModCat.Visible = false; btnIngresarCat.Visible = true; } } }
private void button1_Click(object sender, EventArgs e) { label14.Text = Convert.ToString(totalPagar); for (int a = 0; a < Convert.ToInt32(textBox1.Text); a++) { BLL.ClassColores productos = new BLL.ClassColores(); ClassColores Logica = new ClassColores(); MODELS.Producto claseProd = new MODELS.Producto(); claseProd.ProductoId = Convert.ToInt32(this.dataGridView1.Rows[0].Cells[0].Value.ToString()); claseProd.Estado = false; string resp = Logica.BorrarProducto(claseProd); this.dataGridView1.Refresh(); FacturaXML.Append("<Detalle>"); FacturaXML.Append("<Producto>"); FacturaXML.Append(this.dataGridView1.Rows[0].Cells[0].Value.ToString()); FacturaXML.Append("</Producto>"); FacturaXML.Append("<Cantidad>"); FacturaXML.Append(1); FacturaXML.Append("</Cantidad>"); FacturaXML.Append("<Precio>"); FacturaXML.Append("</Precio>"); FacturaXML.Append("<Descuento>"); FacturaXML.Append("</Descuento>"); FacturaXML.Append("<Subtotal>"); FacturaXML.Append("</Subtotal>"); FacturaXML.Append("</Detalle>"); } listBox1.Items.Add(""); listBox1.Refresh(); }
private void btn_Ingresar_Click(object sender, EventArgs e) { DataTable tabla1 = new DataTable(); ClassColores log = new ClassColores(); this.dataGridView1.DataSource = log.MostrarLogin(txtUsuario.Text, txtPassword.Text); this.dataGridView1.Refresh(); log = new ClassColores(); this.dataGridView2.DataSource = log.MostrarPermisos(Convert.ToInt32(this.dataGridView1.Rows[0].Cells[2].Value)); this.dataGridView2.Refresh(); int codigoUsuario = Convert.ToInt32(this.dataGridView1.Rows[0].Cells[3].Value.ToString()); Administrador d = new Administrador(); Principal p = new Principal(codigoUsuario); p.button1.Visible = false; p.button2.Visible = false; p.button3.Visible = false; p.button6.Visible = false; if (dataGridView1.Rows != null) { for (int i = 0; i < dataGridView2.Rows.Count; i++) { if (dataGridView2.Rows[i].Cells[0].Value.ToString() == "1") { p.button1.Visible = true; } else if (dataGridView2.Rows[i].Cells[0].Value.ToString() == "2") { p.button2.Visible = true; } else if (dataGridView2.Rows[i].Cells[0].Value.ToString() == "3") { p.button3.Visible = true; } else if (dataGridView2.Rows[i].Cells[0].Value.ToString() == "4") { } else if (dataGridView2.Rows[i].Cells[0].Value.ToString() == "5") { } else if (dataGridView2.Rows[i].Cells[0].Value.ToString() == "6") { p.button6.Visible = true; } else if (dataGridView2.Rows[i].Cells[0].Value.ToString() == "7") { p.button4.Visible = true; } } //d.Show(); p.Show(); } }
private void button5_Click(object sender, EventArgs e) { BLL.ClassColores existencia = new ClassColores(); if (existencia.ExisteProd(Convert.ToInt32(textBox2.Text)) == true) { /// BLL.ClassColores prod = new ClassColores(); this.dataGridView4.DataSource = prod.MostrarProductoE(Convert.ToInt32(textBox2.Text)); this.dataGridView4.Refresh(); if (dataGridView1.Rows.Count > 0) { FacturaXML.Append("<Detalle>"); FacturaXML.Append("<Producto>"); FacturaXML.Append(Convert.ToInt32(this.dataGridView4.Rows[0].Cells[0].Value.ToString())); FacturaXML.Append("</Producto>"); FacturaXML.Append("<Cantidad>"); FacturaXML.Append(1); FacturaXML.Append("</Cantidad>"); FacturaXML.Append("<Precio>"); FacturaXML.Append(Convert.ToInt32(this.dataGridView4.Rows[0].Cells[2].Value.ToString())); FacturaXML.Append("</Precio>"); FacturaXML.Append("<Descuento>"); FacturaXML.Append(Convert.ToInt32(textBox1.Text)); FacturaXML.Append("</Descuento>"); FacturaXML.Append("<Subtotal>"); FacturaXML.Append(this.dataGridView4.Rows[0].Cells[2].Value.ToString()); FacturaXML.Append("</Subtotal>"); FacturaXML.Append("</Detalle>"); totalPagar += Convert.ToInt32(this.dataGridView4.Rows[0].Cells[2].Value.ToString()); label14.Text = Convert.ToString(totalPagar); listBox1.Items.Add(this.dataGridView4.Rows[0].Cells[0].Value.ToString() + " - " + this.dataGridView4.Rows[0].Cells[1].Value.ToString() + "-" + this.dataGridView4.Rows[0].Cells[3].Value.ToString() + "-" + this.dataGridView4.Rows[0].Cells[4].Value.ToString() + "-" + this.dataGridView4.Rows[0].Cells[5].Value.ToString()); textBox2.Text = ""; //Actualizar y eliminar producto ClassColores Logica = new ClassColores(); MODELS.Producto claseProd = new MODELS.Producto(); claseProd.ProductoId = Convert.ToInt32(this.dataGridView4.Rows[0].Cells[0].Value); claseProd.Estado = false; claseProd.TipoProductoId = Convert.ToInt32(this.dataGridView4.Rows[0].Cells[6].Value); string resp = Logica.ActualizarProd(claseProd); MessageBox.Show(resp); } else { MessageBox.Show("El producto no existe"); textBox2.Text = ""; } } else { MessageBox.Show("El producto no existe"); textBox2.Text = ""; } }
private void button4_Click(object sender, EventArgs e) { if (MessageBox.Show("¿Está seguro de ingresar?", "Ingreso", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { ClassColores Logica = new ClassColores(); string resultado = Logica.NuevoCliente(textBox5.Text, textBox6.Text, textBox7.Text, textBox8.Text, textBox9.Text); MessageBox.Show(resultado); this.Close(); } }
void MostrarDatos() { ClassColores Datos = new ClassColores(); this.dataGridView2.DataSource = Datos.MostrarMarca(); this.dataGridView2.Refresh(); Datos = new ClassColores(); this.dataGridView1.DataSource = Datos.MostrarMarca(); this.dataGridView1.Refresh(); }
public void ActProductos() { for (int a = 0; a < dataGridView1.Rows.Count; a++) { ClassColores Logica = new ClassColores(); MODELS.Producto claseProducto = new MODELS.Producto(); claseProducto.ProductoId = Convert.ToInt32(this.dataGridView1.Rows[a].Cells[0].Value.ToString()); claseProducto.Estado = true; claseProducto.TipoProductoId = Convert.ToInt32(this.dataGridView1.Rows[a].Cells[4].Value.ToString()); string resp = Logica.ActualizarProd(claseProducto); } }
private void button1_Click_1(object sender, EventArgs e) { if (MessageBox.Show("¿Está seguro de ingresar?", "Ingreso", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { BLL.ClassColores tipo = new ClassColores(); tipo.NuevoTipoProducto(textBox4.Text, Convert.ToInt32(textBox5.Text), textBox6.Text, Convert.ToInt32(comboBox2.SelectedValue), Convert.ToInt32(comboBox3.SelectedValue), Convert.ToInt32(comboBox1.SelectedValue)); textBox4.Text = ""; textBox5.Text = ""; textBox6.Text = ""; MostrarDatos(); } }
private void button5_Click(object sender, EventArgs e) { if (MessageBox.Show("¿Está seguro de ingresar?", "Ingreso", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { if (textBox2.Text == "") { MessageBox.Show("Ingrese la informacion correctamente"); } else { ClassColores Logica = new ClassColores(); string resultado = Logica.NuevaMarca(textBox2.Text); MessageBox.Show(resultado); MostrarDatos(); } } }
private void button6_Click(object sender, EventArgs e) { string nit = InputDialog.mostrar("Introduzca el nit del usuario."); BLL.ClassColores ob = new ClassColores(); bool existe = ob.ExisteNit(nit); if (existe == true) { MessageBox.Show("Usuario existe"); InsertarFormHija(new FormVenta(nit, usercode)); } else if (existe == false) { MessageBox.Show("Usuario no existe"); InsertarFormHija(new NuevoCliente()); } }
private void FormVenta_Load(object sender, EventArgs e) { BLL.ClassColores productos = new BLL.ClassColores(); textBox1.Text = "0"; productos = new ClassColores(); this.dataGridView3.DataSource = productos.MostrarClienteNIT(cliente); textBox4.Enabled = false; textBox5.Enabled = false; textBox6.Enabled = false; textBox7.Enabled = false; textBox3.Enabled = false; textBox4.Text = this.dataGridView3.Rows[0].Cells[1].Value.ToString(); textBox5.Text = this.dataGridView3.Rows[0].Cells[5].Value.ToString(); textBox6.Text = Convert.ToString(empl); textBox7.Text = Convert.ToString(DateTime.Now); productos = new ClassColores(); this.dataGridView1.DataSource = productos.MostrarIdCliente(textBox5.Text); textBox3.Text = (this.dataGridView1.Rows[0].Cells[0].Value.ToString()); //XML if (FacturaXML.Length <= 0) { FacturaXML.Append("<Factura>"); FacturaXML.Append("<Encabezado>"); FacturaXML.Append("<Cliente>"); FacturaXML.Append(Convert.ToInt32(textBox3.Text)); FacturaXML.Append("</Cliente>"); FacturaXML.Append("<Usuario>"); FacturaXML.Append(Convert.ToInt32(textBox6.Text)); FacturaXML.Append("</Usuario>"); FacturaXML.Append("<Pago>"); FacturaXML.Append("</Pago>"); FacturaXML.Append("<Fecha>"); FacturaXML.Append(textBox7.Text); FacturaXML.Append("</Fecha>"); FacturaXML.Append("</Encabezado>"); FacturaXML.Append("<Cuerpo>"); } }
private void button2_Click(object sender, EventArgs e) { if (MessageBox.Show("¿Está seguro de modificar?", "Modificación", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { if (textBox4.Text == "") { MessageBox.Show("Ingrese la informacion correctamente"); } else { ClassColores Logica = new ClassColores(); MODELS.Marca claseMarca = new MODELS.Marca(); claseMarca.MarcaId = Convert.ToInt32(this.dataGridView2.CurrentRow.Cells[0].Value.ToString()); claseMarca.NombreMarca = textBox4.Text; string resp = Logica.ActualizarMarca(claseMarca); MessageBox.Show(resp); MostrarDatos(); } } }
private void button2_Click_1(object sender, EventArgs e) { if (MessageBox.Show("¿Está seguro de modificar?", "Modificación", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { ClassColores Logica = new ClassColores(); MODELS.TipoProducto claseTipo = new MODELS.TipoProducto(); claseTipo.TipoProductoId = Convert.ToInt32(this.dataGridView4.CurrentRow.Cells[0].Value.ToString()); claseTipo.Nombre = textBox4.Text; claseTipo.Color = textBox6.Text; claseTipo.Precio = Convert.ToInt32(textBox5.Text); claseTipo.CategoriaId = Convert.ToInt32(comboBox1.SelectedValue); claseTipo.MedidaId = Convert.ToInt32(comboBox2.SelectedValue); claseTipo.MarcaId = Convert.ToInt32(comboBox3.SelectedValue); string resp = Logica.ActualizarTipo(claseTipo); textBox4.Text = ""; textBox5.Text = ""; textBox6.Text = ""; button1.Visible = true; MessageBox.Show(resp); MostrarDatos(); } }
private void MostrarDatos() { BLL.ClassColores datos = new ClassColores(); this.dataGridView1.DataSource = datos.MostrarCategoria(); this.dataGridView1.Refresh(); datos = new ClassColores(); this.dataGridView2.DataSource = datos.MostrarMedida(); this.dataGridView2.Refresh(); datos = new ClassColores(); this.dataGridView3.DataSource = datos.MostrarMarca(); this.dataGridView3.Refresh(); datos = new ClassColores(); this.comboBox1.DataSource = datos.MostrarCategoria(); this.comboBox1.DisplayMember = "Nombre"; this.comboBox1.ValueMember = "Codigo_Categoria"; this.comboBox1.Refresh(); datos = new ClassColores(); this.comboBox2.DataSource = datos.MostrarMedida(); this.comboBox2.DisplayMember = "Medida"; this.comboBox2.ValueMember = "Codigo_Medida"; this.comboBox2.Refresh(); datos = new ClassColores(); this.comboBox3.DataSource = datos.MostrarMarca(); this.comboBox3.DisplayMember = "NombreMarca"; this.comboBox3.ValueMember = "Codigo_Marca"; this.comboBox3.Refresh(); datos = new ClassColores(); this.dataGridView4.DataSource = datos.MostrarTipo(); this.dataGridView4.Refresh(); }