コード例 #1
0
        private void btnInventario_Click(object sender, EventArgs e)
        {
            frmMenu_Inventario fmi = new frmMenu_Inventario(user);

            fmi.Show();
        }
コード例 #2
0
        private void btnFinalizar_Click(object sender, EventArgs e)
        {
            limpia();
            List <string>   listaUpdate = new List <string>();
            List <string>   listaCont   = new List <string>();
            SqlCeDataReader rs          = null;
            Stack           st          = new Stack();
            int             contador    = 0;

            try
            {
                int cuenta = getIntSDF("select count(*)FROM detalleInvCong WHERE (Estatus = 1)");
                if (cuenta > 0)
                {
                    SqlCeCommand select = new SqlCeCommand("SELECT IDDetInvCong, Conteo1  FROM detalleInvCong  WHERE (Estatus = 1)", conexion);
                    conexion.Open();
                    rs = select.ExecuteReader();
                    while (rs.Read())
                    {
                        listaUpdate.Add(rs.GetValue(0).ToString());
                        listaCont.Add(rs.GetValue(1).ToString());
                    }

                    int registros = listaUpdate.Count;
                    for (int z = 0; z < registros; z++)
                    {
                        int cosa = ws.inserta("UPDATE detalleInvCong SET Estatus = 1, Conteo1 =  " + listaCont[z] + " WHERE IDDetInvCong = " + listaUpdate[z], "ConsolaAdmin");
                        if (cosa == 1)
                        {
                            contador += 1;
                        }
                    }

                    conexion.Close();
                    if ((contador > 0))
                    {
                        /////*
                        if (ws.inserta("update InventarioCongelado SET estatus = 1 WHERE IDInv =" + IdInv, "ConsolaAdmin") == 1)
                        {
                            MessageBox.Show("Transferencia completa", "EXITO");
                        }

                        /////*
                        ///// solo pruebas
                        MessageBox.Show("Transferencia completa-//Tabla InventarioCongelado omitida", "EXITO");

                        //this.Dispose();
                        this.Close();
                        return;
                    }
                }
                else
                {
                    MessageBox.Show("No se realizó ningun cambio", "Informacion");
                    frmMenu_Inventario fmi = new frmMenu_Inventario(usuario);
                    fmi.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ERROR");
            }
        }