コード例 #1
0
ファイル: FrmLectora.cs プロジェクト: nark0s1s/emma_desktop
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            LectoraBR oBR = new LectoraBR();

            if (dgv.RowCount > 0)
            {
                int oid = new int();

                if (dgv.RowCount > 1)
                {
                    oid = int.Parse(dgv.Rows[dgv.SelectedRows[0].Index].Cells[0].Value.ToString());
                }
                else
                {
                    oid = int.Parse(dgv.Rows[0].Cells[0].Value.ToString());
                }

                oBR.Eliminar(oid);

                CargarDGV();

                MessageBox.Show("Lectora Eliminado");
            }

            else
            {
                MessageBox.Show("Debe Seleccionar una Lectora");
            }
        }
コード例 #2
0
ファイル: FrmLectora.cs プロジェクト: nark0s1s/emma_desktop
        public void CargarDGV()
        {
            LectoraBR oLectoraBR = new LectoraBR();

            dt                     = oLectoraBR.ObtenerListado();
            dgv.DataSource         = dt;
            dgv.Columns[0].Visible = false;
        }
コード例 #3
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            LectoraBE oBE = new LectoraBE();
            LectoraBR oBR = new LectoraBR();

            oBE.val_desc = txtDescripcion.Text;

            oBE.proy_oid_proy = Global.oid_proy;

            DataRowView rvCome = cboComedor.SelectedItem as DataRowView;

            oBE.come_oid_come_aten = Int32.Parse(rvCome["Codigo"].ToString());

            if ((cboEstado.SelectedItem as ComboBoxItem).Value.ToString() == "1")
            {
                oBE.ind_acti = 1;
            }
            else
            {
                oBE.ind_acti = 0;
            };

            if (mod == "C")
            {
                oBR.Insertar(oBE);
            }
            else
            {
                oBE.oid_lect = Int32.Parse(txtOid.Text);
                oBR.Actualizar(oBE);
            }


            oFrm.CargarDGV();

            this.Close();
        }
コード例 #4
0
        /*
         * private void cboCliente_SelectedIndexChanged(object sender, EventArgs e)
         * {
         *  ProyectoBR oBRProyecto = new ProyectoBR();
         *
         *  DataTable dt = new DataTable();
         *
         *  DataRowView rv = cboCliente.SelectedItem as DataRowView;
         *
         *  int oid_clie;
         *
         *  oid_clie = Int32.Parse(rv["Codigo"].ToString());
         *
         *  dt = oBRProyecto.ObtenerListadoPorCliente(oid_clie);
         *  cboProyecto.DataSource = dt;
         *  cboProyecto.DisplayMember = "Descripcion";
         *
         * }
         */

        private void cboComedor_SelectedIndexChanged(object sender, EventArgs e)
        {
            LectoraBR oBRLectora = new LectoraBR();

            DataTable dt = new DataTable();

            DataRowView rv = cboComedor.SelectedItem as DataRowView;

            int oid_come;

            oid_come = Int32.Parse(rv["Codigo"].ToString());

            dt = oBRLectora.ObtenerListadoPorComedor(oid_come);
            cboLectora.DataSource    = dt;
            cboLectora.DisplayMember = "Descripcion";

            TipoServicioComedorBR oBRTipoServicioComedor = new TipoServicioComedorBR();

            DataTable dts = new DataTable();

            dts = oBRTipoServicioComedor.ObtenerListadoPorComedor(oid_come);
            cboTipoServicio.DataSource    = dts;
            cboTipoServicio.DisplayMember = "Descripcion";
        }