Beispiel #1
0
        private void Guardar()
        {
            objPrestamo = new ClsPrestamo();

            objPrestamo.opc = 2; //Para ejecutar el select en el Sp

            objPrestamo.idUsuario     = int.Parse(txtIdUsuario.Text);
            objPrestamo.idLibro       = txtIdLibro.Text;
            objPrestamo.fechaPrestamo = Convert.ToDateTime(dTPrestamo.Value.Date.ToString("yyy-MM-dd"));
            objPrestamo.fechaEntrega  = Convert.ToDateTime(dTEntrega.Value.Date.ToString("yyy-MM-dd"));

            objPrestamoMgr = new ClsPrestamoMgr(objPrestamo);
            try
            {
                objPrestamoMgr.Guardar();
                LimpiarCampos();
                ConsultarUsuario();
                Listar();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            MessageBox.Show("Prestamo de libro registrado correctamente", "Mensaje");
        }