Пример #1
0
        private void btnEliminarorden_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Seguro que desea eliminar la orden " + cmbAppordereliminar.Text + "?",
                                "HUGO", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                apporder z = (apporder)cmbAppordereliminar.SelectedItem;
                apporderDAO.eliminar(z.idorder);

                MessageBox.Show("¡Orden eliminada exitosamente!",
                                "HUGO", MessageBoxButtons.OK, MessageBoxIcon.Information);

                actualizarControlesCommon();
            }
        }
Пример #2
0
        public static List <apporder> getLista()
        {
            string sql = "select * from apporder";

            DataTable dt = Conexion.realizarConsulta(sql);

            List <apporder> lista = new List <apporder>();

            foreach (DataRow fila in dt.Rows)
            {
                apporder u = new apporder();
                u.idorder    = Convert.ToInt32(fila[0].ToString());
                u.createdate = fila[1].ToString();
                u.idproduct  = Convert.ToInt32(fila[2].ToString());
                u.idaddress  = Convert.ToInt32(fila[3].ToString());

                lista.Add(u);
            }
            return(lista);
        }