예제 #1
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            TurnoBE oBE = new TurnoBE();
            TurnoBR oBR = new TurnoBR();

            oBE.proy_oid_proy = Global.oid_proy;

            DataRowView rvCome = cboComedor.SelectedItem as DataRowView;

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

            DataRowView rvTipoServ = cboTipoServicio.SelectedItem as DataRowView;

            oBE.tise_cod_tipo_serv = rvTipoServ["Codigo"].ToString();

            DataRowView rvLect = cboLectora.SelectedItem as DataRowView;

            oBE.lect_oid_lect = Int32.Parse(rvLect["Codigo"].ToString());

            oBE.val_fech = dtpFecha.Value.Date.ToString("dd/MM/yyyy");

            int ind_vali;

            ind_vali = oBR.ValidarTurno(oBE);


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

                oFrm.CargarDGV();

                this.Close();
            }
            else
            {
                MessageBox.Show("El Turno ya ha sido creado",
                                "Advertencia",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
            }
        }
예제 #2
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            TurnoBE oBE = new TurnoBE();
            TurnoBR oBR = new TurnoBR();

            //oBE.val_fech = txtDescripcion.Text;

            //MessageBox.Show(dtpFecha.Value.Date.ToString("dd/MM/yyyy"));

            oBE.val_fech = dtpFecha.Value.Date.ToString("dd/MM/yyyy");


            oBR.Insertar(oBE);

            oFrm.CargarDGV();

            this.Close();
        }