Example #1
0
        private void Btn_Aceptar_Click(object sender, EventArgs e)
        {
            try
            {
                Datos.Turno T = new Datos.Turno();

                T.Id_Turno   = (int)id_TurnoNumericUpDown.Value;
                T.Id_Tercero = (int)id_TerceroNumericUpDown.Value;

                DateTime FechaHora = Convert.ToDateTime(fecha_TurnoDateTimePicker.Value.ToShortDateString() + " " + Hora_TurnoDateTimePicker.Value.ToString("HH:mm:ss"));
                T.Fecha_Turno         = FechaHora;
                T.Observaciones_Turno = observaciones_TurnoTextBox.Text;

                if (id_TurnoNumericUpDown.Value == 0)
                {
                    Datos.Turno.Add(T);
                    MessageBox.Show("Se ha agregado un nuevo registro.");
                }
                else
                {
                    Datos.Turno.Set(T);
                    MessageBox.Show("Se ha modificado correctamente el registro.");
                }
                Cerrar = true;
                Close();
            }
            catch (Exception Error)
            {
                MessageBox.Show(Error.Message);
            }
        }
Example #2
0
 public System.Data.DataTable Listar(string condicion, params object[] args)
 {
     try
     {
         DTurno_ = new Datos.Turno();
         return(DTurno_.Listar(condicion, args));
     }
     catch (System.Exception ex)
     {
         throw new System.Exception("Turno: Error al listar. \n" + ex.Message);
     }
 }
Example #3
0
 public void Eliminar( System.Int32 id )
 {
     try
     {
         DTurno_ = new Datos.Turno ();
         DTurno_.id = id;
         DTurno_.Eliminar ();
     }
     catch ( System.Exception ex )
     {
         throw new System.Exception ( "Turno: Error al eliminar. \n" + ex.Message );
     }
 }
Example #4
0
 public System.Data.DataRow Obtener(System.Int32 id)
 {
     try
     {
         DTurno_    = new Datos.Turno();
         DTurno_.id = id;
         return(DTurno_.Obtener());
     }
     catch (System.Exception ex)
     {
         throw new System.Exception("Turno: Error al obtener datos. \n" + ex.Message);
     }
 }
Example #5
0
 public void Eliminar(System.Int32 id)
 {
     try
     {
         DTurno_    = new Datos.Turno();
         DTurno_.id = id;
         DTurno_.Eliminar();
     }
     catch (System.Exception ex)
     {
         throw new System.Exception("Turno: Error al eliminar. \n" + ex.Message);
     }
 }
Example #6
0
        private void Buscar()
        {
            try
            {
                //Borro todo las filas y columnas anteriores
                DG_Datos.Columns.Clear();
                DG_Datos.Rows.Clear();

                //Busco la lista de datos
                Datos.Turno T = Datos.Turno.GetTurnoRelacional(Txt_Id.Text, TXT_Paciente.Text);

                //Agrego las columnas de la regilla de datos.
                DG_Datos.Columns.Add("Clm_Paciente", "Paciente");
                DG_Datos.Columns.Add("Clm_Fecha", "Fecha y hora");
                DG_Datos.Columns.Add("Clm_Observaciones", "Observaciones");

                DG_Datos.Font = new Font(Config.NombreFont, Config.TamaƱoFont);
                DG_Datos.Columns["Clm_Paciente"].AutoSizeMode      = DataGridViewAutoSizeColumnMode.AllCells;
                DG_Datos.Columns["Clm_Fecha"].AutoSizeMode         = DataGridViewAutoSizeColumnMode.AllCells;
                DG_Datos.Columns["Clm_Observaciones"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

                //Agrego las filas
                int CantidadRegistro = 0;
                foreach (Datos.Turno ItemTurno in T.ListaTurno)
                {
                    if (DT_Desde.Value <= ItemTurno.Fecha_Turno && DT_Desde.Value <= ItemTurno.Fecha_Turno)
                    {
                        CantidadRegistro++;
                        DG_Datos.Rows.Add();
                        DG_Datos.Rows[DG_Datos.Rows.Count - 1].Tag = ItemTurno.Id_Turno;

                        DG_Datos.Rows[DG_Datos.Rows.Count - 1].Cells["Clm_Paciente"].Value      = ItemTurno.Tercero.Razon_Social_Tercero;
                        DG_Datos.Rows[DG_Datos.Rows.Count - 1].Cells["Clm_Fecha"].Value         = ItemTurno.Fecha_Turno;
                        DG_Datos.Rows[DG_Datos.Rows.Count - 1].Cells["Clm_Observaciones"].Value = ItemTurno.Observaciones_Turno;
                    }
                }

                Txt_CantidadRegistros.Text = CantidadRegistro.ToString();

                if (NumeroFilaUltimaSeleccion != 0 && DG_Datos.Rows.Count > NumeroFilaUltimaSeleccion)
                {
                    DG_Datos.Rows[NumeroFilaUltimaSeleccion].Selected = true;
                }
            }
            catch (Exception Error)
            {
                MessageBox.Show(Error.Message);
            }
        }
Example #7
0
 public void Actualizar( System.Int32 id, System.String descricion )
 {
     try
     {
         DTurno_ = new Datos.Turno ();
         DTurno_.id = id;
         DTurno_.descricion = descricion;
         ;
         DTurno_.Actualizar ();
     }
     catch ( System.Exception ex )
     {
         throw new System.Exception ( "Turno: Error al actualizar. \n" + ex.Message );
     }
 }
Example #8
0
 public void Actualizar(System.Int32 id, System.String descricion)
 {
     try
     {
         DTurno_            = new Datos.Turno();
         DTurno_.id         = id;
         DTurno_.descricion = descricion;
         ;
         DTurno_.Actualizar();
     }
     catch (System.Exception ex)
     {
         throw new System.Exception("Turno: Error al actualizar. \n" + ex.Message);
     }
 }
Example #9
0
 public System.Int32 Insertar( System.String descricion )
 {
     try
     {
         DTurno_ = new Datos.Turno ();
         DTurno_.descricion = descricion;
         int i = DTurno_.Insertar ();
         if ( i < 0 )
             throw new System.Exception ( "Turno: Error al insertar. \n" );
         return i;
     }
     catch ( System.Exception ex )
     {
         throw new System.Exception ( "Turno: Error al insertar. \n" + ex.Message );
     }
 }
Example #10
0
 public System.Int32 Insertar(System.String descricion)
 {
     try
     {
         DTurno_            = new Datos.Turno();
         DTurno_.descricion = descricion;
         int i = DTurno_.Insertar();
         if (i < 0)
         {
             throw new System.Exception("Turno: Error al insertar. \n");
         }
         return(i);
     }
     catch (System.Exception ex)
     {
         throw new System.Exception("Turno: Error al insertar. \n" + ex.Message);
     }
 }
Example #11
0
        public FrmTurnosABM(string IdTurno)
        {
            InitializeComponent();
            try
            {
                //Busco el una unica fila por su id
                Datos.Turno T = Datos.Turno.GetTurnoRelacional(IdTurno, "").ListaTurno[0];

                id_TurnoNumericUpDown.Value   = T.Id_Turno;
                id_TerceroNumericUpDown.Value = T.Id_Tercero;
                Txt_NombrePaciente.Text       = T.Tercero.Razon_Social_Tercero;

                Hora_TurnoDateTimePicker.Value  = T.Fecha_Turno;
                fecha_TurnoDateTimePicker.Value = T.Fecha_Turno;
                observaciones_TurnoTextBox.Text = T.Observaciones_Turno;
            }
            catch (Exception Error)
            {
                MessageBox.Show(Error.Message);
            }
        }
Example #12
0
 public System.Data.DataRow Obtener( System.Int32 id )
 {
     try
     {
         DTurno_ = new Datos.Turno ();
         DTurno_.id = id;
         return DTurno_.Obtener ();
     }
     catch ( System.Exception ex )
     {
         throw new System.Exception ( "Turno: Error al obtener datos. \n" + ex.Message );
     }
 }
Example #13
0
 public System.Data.DataTable Listar( string condicion, params object[] args )
 {
     try
     {
         DTurno_ = new Datos.Turno ();
         return DTurno_.Listar ( condicion, args );
     }
     catch ( System.Exception ex )
     {
         throw new System.Exception ( "Turno: Error al listar. \n" + ex.Message );
     }
 }
Example #14
0
 public System.Data.DataTable Listar()
 {
     DTurno_ = new Datos.Turno ();
     return DTurno_.Listar ();
 }
Example #15
0
 public System.Data.DataTable Listar()
 {
     DTurno_ = new Datos.Turno();
     return(DTurno_.Listar());
 }