Exemplo n.º 1
0
        private void bGuardar_Click(object sender, EventArgs e)
        {
            if (Precio.Value.ToString() == "0.00")
            {
                MessageBox.Show("El precio no Puede ser Cero", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                Precio.Focus();
                return;
            }
            string FechaHora = Fecha.Text + " " + Hora.Value.ToString().Substring(Hora.Value.ToString().IndexOf(" "), Hora.Value.ToString().Length - Hora.Value.ToString().IndexOf(" "));



            dtPrecios = C.SQL("ARTICULOSPRECIOS_M " + vOpt + C.QII + PrecioID + C.QII + vArticuloID + C.QII + Precio.Value + C.QII + 1 + C.QIS +
                              FechaHora.Replace("p.m.", "PM").Replace("a.m.", "AM") + C.QSI + C.vUserID);

            if (dtPrecios.Rows[0]["R"].ToString() == "0")
            {
                GRD.DataSource = dtPrecios;
                bNuevo_Click(null, null);
                MessageBox.Show("Guardado Con Exito", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                GRD.DataSource = C.SQL("ARTICULOSPRECIOS_L " + vArticuloID);
                MessageBox.Show(dtPrecios.Rows[0]["msgbox"].ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 2
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (Precio.Text.Trim().Length == 0)
     {
         MessageBox.Show("Ingresa el precio para poder continuar!!!");
         Precio.Focus();
         return;
     }
     if (NProducto.Text.Trim().Length == 0)
     {
         MessageBox.Show("Ingresa el Nombre del producto!!!");
         NProducto.Focus();
         return;
     }
     if (MessageBox.Show("Desea Modificar" + dataGridView1[1, rowSelect].Value.ToString() + "Precio:" + dataGridView1[2, rowSelect].Value.ToString(), "Eliminar Producto", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         dataGridView1[1, rowSelect].Value = NProducto.Text;
         dataGridView1[2, rowSelect].Value = Precio.Text;
     }
     limpiar();
 }