Example #1
0
    protected void btnagregar_Click(object sender, EventArgs e)
    {
        Tickets usr = new Tickets();

        if (ddlPaciente.SelectedIndex != 0 && ddlTipoPago.SelectedIndex != 0 && ddlPago.SelectedIndex != 0)
        {
            usr.getTicket(int.Parse(ddlPaciente.SelectedItem.Value), int.Parse(ddlPago.SelectedIndex.ToString()), int.Parse(ddlTipoPago.SelectedIndex.ToString()));
            Turnos t = new Turnos();
            t.setIdPaciente(int.Parse(ddlPaciente.SelectedItem.Value));
            if (usr.agregarTicket(usr) > 0)
            {
                t.ActualizarMarca(t);
                Response.Write("<script>alert('Pago guardado corectamente')</script>");
                Response.Redirect("VerTickets.aspx");
            }
            else
            {
                Response.Write("<script>alert('No se pudo guardar el Pago')</script>");
            }
        }
        else
        {
            Response.Write("<script>alert('Se debe completar todos los campos')</script>");
        }
    }
Example #2
0
        public IHttpActionResult PutTurnos(int id, Turnos turnos)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != turnos.IdTurno)
            {
                return(BadRequest());
            }

            db.Entry(turnos).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TurnosExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #3
0
        public async Task <Turnos> SaveTurn(Turnos turno)
        {
            string webApiUrl = WebApiMethods.SaveTurn;
            Turnos response  = await App.HttpTools.HttpPostObjectWithResponseDataAsync <Turnos, Turnos>(webApiUrl, turno, "Hubo un error al guardar el turno").ConfigureAwait(false);

            return(response);
        }
Example #4
0
        private void VerTurnosDelDia()
        {
            DataTable tabla = new DataTable();

            tabla = Turnos.GetTurnosDelDiaMedico(Convert.ToInt32(Lbl_Legajo.Text.ToString()));
            GrdPacientesMedico.DataSource         = tabla;
            GrdPacientesMedico.Columns[5].Visible = false;
            GrdPacientesMedico.Columns[6].Visible = false;
            GrdPacientesMedico.Columns[7].Visible = false;
            GrdPacientesMedico.Columns[8].Visible = true;



            foreach (DataGridViewRow row in GrdPacientesMedico.Rows)
            {
                if (Convert.ToBoolean(row.Cells[6].Value.ToString()) && Convert.ToBoolean(row.Cells[7].Value.ToString()))
                {
                    row.DefaultCellStyle.BackColor = Color.Red;
                }
                else if (Convert.ToBoolean(row.Cells[6].Value.ToString()))
                {
                    row.DefaultCellStyle.BackColor = Color.LightBlue;
                }
            }
        }
Example #5
0
 public IActionResult SaveTurno([FromBody] Turnos turno)
 {
     try
     {
         if (ModelState.IsValid)
         {
             if (turno.IdTurno == 0)
             {
                 PosUoW.TurnosRepository.Add(turno);
             }
             else
             {
                 PosUoW.TurnosRepository.Update(turno);
             }
             PosUoW.Save();
             return(Ok(turno));
         }
         else
         {
             return(BadRequest("Los datos de la marca son incorrectos"));
         }
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, ex));
     }
 }
 //metodo sobrecarregado para alvos especificos
 public void OnClick()
 {
     if (Time.time > LastClickButtonTime + buttonCd)
     {
         LastClickButtonTime = Time.time;
         GameObject[] numerosPlayers = GameObject.FindGameObjectsWithTag("PlayerId");
         //NetworkIdentity ntwrkid = NetworkClient.connection.identity;
         //playerid = ntwrkid.GetComponent<PlayerId>();
         if (!testandoNoEditor && numerosPlayers.Length == 2)
         {
             botao.interactable = false;
         }
         if (preparado && (int)turno < System.Enum.GetNames(typeof(Turnos)).Length - 2 && numerosPlayers.Length == 2 || testandoNoEditor)
         {
             turno = turno + 1;
             // //playerid.CmdMudarTurno((int)turno);
             // // if(!testandoNoEditor)
             // //     playerid.CmdInverterTurnoPlayers();
             //if(!testandoNoEditor)
             //playerid.CmdExibirTurno();
         }
         //else só p testar dps tem q tirar isso aq e colocar a derrota ou vitória k
         else if (preparado && numerosPlayers.Length == 2 || testandoNoEditor)
         {
             //playerid.CmdTrocouTurno();
             preparado = false;
         }
         //playerid.CmdInvoke((int)turno);
     }
 }
Example #7
0
        private void BtnBuscarXmedico_Click(object sender, EventArgs e)
        {
            if (CmbMedicos.SelectedIndex == -1)
            {
                MessageBox.Show("Por favor, seleccione un medico", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                BtnConfirmarTurno.Enabled = true;
                int medico = Convert.ToInt32(CmbMedicos.SelectedValue.ToString());
                GrdTurnos.DataSource          = Turnos.TurnosMedico(medico);
                GrdTurnos.Columns[10].Visible = false;
                GrdTurnos.Columns[11].Visible = false;
                GrdTurnos.Columns[12].Visible = false;


                foreach (DataGridViewRow row in GrdTurnos.Rows)
                {
                    if (Convert.ToBoolean(row.Cells[11].Value.ToString()) && Convert.ToBoolean(row.Cells[12].Value.ToString()))
                    {
                        row.DefaultCellStyle.BackColor = Color.Red;
                    }
                    else if (Convert.ToBoolean(row.Cells[11].Value.ToString()))
                    {
                        row.DefaultCellStyle.BackColor = Color.LightBlue;
                    }
                }
            }
        }
Example #8
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Horario h    = (Horario)Session["Horario"];
        string  hora = txtTime.Text.Substring(0, 2);

        if (int.Parse(hora) < h.GetHoraDesde() || int.Parse(hora) > (h.GetHoraHasta() - 2))
        {
            Response.Write("<script>alert('Horario incorrecto, este mismo debe estar entre las " + h.GetHoraDesde() + " y las " + h.GetHoraHasta() + ", el turno dura 2 horas')</script>");
        }
        else
        {
            Turnos usr = new Turnos();
            if (txtFecha.Text != "" && txtTime.Text != "")
            {
                usr.getPaciente(txtFecha.Text, txtTime.Text, ddlPacientes.SelectedIndex);
                Usuarios u = new Usuarios();
                u = (Usuarios)Session["Usuario"];

                if (usr.agregarTurno(usr, u) > 0)
                {
                    Response.Write("<script>alert('Turno guardado corectamente')</script>");
                    VaciarTxt();
                }
                else
                {
                    Response.Write("<script>alert('No se pudo guardar el Turno')</script>");
                    VaciarTxt();
                }
            }
            else
            {
                Response.Write("<script>alert('Se debe completar todos los campos')</script>");
            }
        }
    }
Example #9
0
        /// <summary>
        /// Metodo estatico que inserta un Turno en la base
        /// </summary>
        /// <param name="turno"></param>
        /// <returns></returns>
        public static bool Insertar(Turnos turno)
        {
            bool success = false;

            sqlCommand = new SqlCommand("INSERT INTO Turnos VALUES (@idPaciente,@idEspecialista,@observacionesTurno,@fecha)", sqlConnection);
            sqlCommand.Parameters.Clear();
            sqlCommand.Parameters.Add(new SqlParameter("idPaciente", turno.IdPaciente));
            sqlCommand.Parameters.Add(new SqlParameter("idEspecialista", turno.IdEspecialista));
            sqlCommand.Parameters.Add(new SqlParameter("observacionesTurno", turno.ObservacionTurno));
            sqlCommand.Parameters.Add(new SqlParameter("fecha", turno.FechaTurno));

            try
            {
                sqlConnection.Open();
                sqlCommand.ExecuteNonQuery();
                success = true;
            }
            catch (Exception e)
            {
                Texto error = new Texto();
                error.Guardar($"{e.Message} - Metodo: TurnosDAO.Insertar()");
                success = false;
            }
            finally
            {
                sqlConnection.Close();
            }
            return(success);
        }
Example #10
0
        public List <Turnos> listar()
        {
            AccesoDatos datos = new AccesoDatos();

            try
            {
                List <Turnos> lista = new List <Turnos>();
                datos.setearQuery("Select Id, Nombre from Turnos");
                datos.ejecutarLector();
                while (datos.lector.Read())
                {
                    Turnos turnos = new Turnos();
                    turnos.Id     = datos.lector.GetInt64(0);
                    turnos.Nombre = datos.lector.GetString(1);

                    lista.Add(turnos);
                }

                return(lista);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                datos.cerrarConexion();
            }
        }
Example #11
0
        private void VerTurnos()
        {
            DataTable tabla = new DataTable();

            if (monthCalendarMedico.SelectionStart != null)
            {
                tabla = Turnos.GetDiaMedico(monthCalendarMedico.SelectionStart, Convert.ToInt32(Lbl_Legajo.Text.ToString()));
                GrdPacientesMedico.DataSource = tabla;
                // GrdPacientesMedico.Columns[5].Visible = false;
                GrdPacientesMedico.Columns[10].Visible = false;
                GrdPacientesMedico.Columns[11].Visible = false;
                GrdPacientesMedico.Columns[12].Visible = false;

                foreach (DataGridViewRow row in GrdPacientesMedico.Rows)
                {
                    if (Convert.ToBoolean(row.Cells[11].Value.ToString()) && Convert.ToBoolean(row.Cells[12].Value.ToString()))
                    {
                        row.DefaultCellStyle.BackColor = Color.Red;
                    }
                    else if (Convert.ToBoolean(row.Cells[11].Value.ToString()))
                    {
                        row.DefaultCellStyle.BackColor = Color.LightBlue;
                    }
                }
            }
            else
            {
                MessageBox.Show("Por favor seleccione una fecha en el calendario y/o el medico", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #12
0
        /// <summary>
        /// Si el paciente se encuentra en la base, se guarda el turno en la base. Sino, se graba en un XML
        /// </summary>
        /// <param name="turno"></param>
        /// <returns></returns>
        private bool GuardarTurnos(Turnos turno)
        {
            bool success = false;

            try
            {
                if (PacientesDAO.VerificarPorId(turno.IdPaciente))
                {
                    TurnosDAO.Insertar(turno);
                }
                else
                {
                    var          auxPaciente = Paciente.BuscarPacienteEnListaXmlPorId(AgregarTurnoForm.ListaPacientesXml, turno.IdPaciente);
                    Xml <Turnos> xmlTurno    = new Xml <Turnos>();
                    xmlTurno.Ruta = String.Format("{0}\\SegundoParcialUtn\\TurnosClinica\\{1}-{2}-{3}.xml", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), auxPaciente.Apellido, auxPaciente.Nombre, turno.FechaTurno.ToString("MMMM dd"));
                    xmlTurno.Guardar(turno);
                }
                success = true;
            }
            catch (Exception e)
            {
                Texto error = new Texto();
                error.Guardar($"{e.Message} - Metodo: GuardarTurnos()");
                success = false;
            }
            return(success);
        }
Example #13
0
        public void ActualizarGrilla()
        {
            listaTurnos = Turnos.ObtenerTurnos(this.unAfiliado.Codigo_Persona);

            //meto el resultado en la grilla
            grillaTurnos.DataSource = listaTurnos;
        }
Example #14
0
        private void btnAction_Click(object sender, EventArgs e)
        {
            try
            {
                unTurno = (Turno)grillaHorarios.CurrentRow.DataBoundItem;
                unTurno.Codigo_Profesional  = unProfesional.Id;
                unTurno.Codigo_Especialidad = unaEspecialidad;
                unTurno.Codigo_Persona      = unAfiliado.Codigo_Persona;

                nro_turno = Turnos.AgregarTurno(unTurno);
                if (nro_turno != 0)
                {
                    MessageBox.Show("El turno numero " + nro_turno + " se ha registrado con exito!", "Aviso", MessageBoxButtons.OK);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("El turno que desea tomar se encuentra ocupado. Seleccione otro horario por favor.", "Error", MessageBoxButtons.OK);
                }
            }
            catch
            {
                MessageBox.Show("No se ha seleccionado ningun turno, por favor seleccione uno", "Aviso", MessageBoxButtons.OK);
            }
        }
Example #15
0
        private void cmdBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                if (!Utiles.ObtenerDiasHabilesAgenda(unaAgenda).Contains(new Dias(dtpFechas.Value.DayOfWeek).Id))
                {
                    MessageBox.Show("La fecha seleccionada no forma parte de la agenda del profesional, por favor seleccione otra", "Aviso", MessageBoxButtons.OK);
                    limpiarGrilla();
                }
                else
                {
                    limpiarGrilla();

                    listaCompleta = Utiles.ObtenerTurnosAgenda(unaAgenda, ((DateTime)dtpFechas.Value).Date);

                    foreach (Turno turno in listaCompleta)
                    {
                        if (Turnos.VerificarTurnoLibre(turno))
                        {
                            listaTurnos.Add(turno);
                        }
                    }

                    grillaHorarios.DataSource = listaTurnos;
                }
            }
            catch
            {
                MessageBox.Show("La fecha seleccionada no esta disponible, por favor seleccione otra", "Aviso", MessageBoxButtons.OK);
                limpiarGrilla();
            }
        }
Example #16
0
        /** Turnos **/
        public Turnos ObtenerTurnos(int idTurno)
        {
            Turnos objeto = new Turnos();
            Type   clase  = objeto.GetType();

            return((Turnos)this.Obtener(idTurno, clase));
        }
Example #17
0
        private void btnAction_Click(object sender, EventArgs e)
        {
            if (txtMotivo.Text != "")
            {
                try
                {
                    unTurno = (Turno)grillaTurnos.CurrentRow.DataBoundItem;

                    if ((Utiles.EsFechaValidaPorUnDia(DateTime.Parse(System.Configuration.ConfigurationSettings.AppSettings["Fecha"]).Date, unTurno.Fecha.Date)))
                    {
                        Turnos.Cancelar(unTurno, (decimal)cmbCancelacion.SelectedValue, txtMotivo.Text);
                        MessageBox.Show("El turno se ha cancelado con exito!", "Aviso", MessageBoxButtons.OK);
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("El turno no puede cancelarse por ser en menos de 24hs.", "Aviso", MessageBoxButtons.OK);
                    }
                }
                catch
                {
                    MessageBox.Show("No se ha seleccionado ningun turno o tiene campos sin completar!", "Error", MessageBoxButtons.OK);
                }
            }
            else
            {
                MessageBox.Show("No se ha indicado el motivo de la cancelacion, por favor ingreselo y vuelva a intentarlo", "Error", MessageBoxButtons.OK);
            }
        }
Example #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Docentes docenteLogeado = new Docentes();

            docenteLogeado = (Docentes)Session["docenteLogeado"];

            if (docenteLogeado == null)
            {
                Response.Redirect("Login.aspx");
            }



            Page.UnobtrusiveValidationMode = System.Web.UI.UnobtrusiveValidationMode.None;


            if (!IsPostBack)
            {
                Materia        materia      = new Materia();
                Turnos         turno        = new Turnos();
                MateriaNegocio NegMateria   = new MateriaNegocio();
                TurnosNegocio  turnoNegocio = new TurnosNegocio();

                dwMateria.DataSource     = NegMateria.listar();
                dwMateria.DataValueField = "Id";
                dwMateria.DataTextField  = "Nombre";
                dwMateria.DataBind();

                dwTurnos.DataSource     = turnoNegocio.listar();
                dwTurnos.DataValueField = "Id";
                dwTurnos.DataTextField  = "Nombre";
                dwTurnos.DataBind();
            }
        }
Example #19
0
        //**************************************************
        //*             FILL DATA ON START
        //**************************************************

        #region Write data
        private void saveTurn()
        {
            if (turnosToSave.IdTurno.Equals(0))
            {
                turnosToSave = _turnPresenter.SaveTurn(turnosToSave).Result;
                if (turnosToSave != null && turnosToSave.Estatus)
                {
                    turnsList.Add(turnosToSave);
                }
            }
            else
            {
                if (!turnosToSave.Estatus)
                {
                    _turnPresenter.SaveTurn(turnosToSave);
                    turnsList.Remove(turnosToSave);
                }
                else
                {
                    turnosToSave           = _turnPresenter.SaveTurn(turnosToSave).Result;
                    searchTurnTextBox.Text = string.Empty;
                    turnsList.Clear();
                    turnsList.AddRange(_turnPresenter.GetAllTurns());
                }
            }
        }
 public static bool Altaturnos(Turnos turnos)
 {
     try
     {
         using (System.Data.IDbConnection db = new System.Data.SqlClient.SqlConnection(_db))
         {
             DynamicParameters param = new DynamicParameters();
             db.Open();
             param.Add("@nombre", turnos.Nombre);
             param.Add("@Inicio", turnos.Inicio);
             param.Add("@Fin", turnos.Fin);
             param.Add("@Categoria", turnos.Categoria);
             param.Add("@Tolerancia", turnos.Tolerancia);
             param.Add("@InicioF", turnos.InicioF);
             param.Add("@Finf", turnos.FinF);
             db.Execute("sp_Altaturnos", param, commandType: CommandType.StoredProcedure);
             db.Close();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
     return(true);
 }
Example #21
0
        private void turnGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DataGrid dataGrid = (DataGrid)sender;

            turnosToSave          = dataGrid.SelectedItem as Turnos;
            txtName.Text          = turnosToSave.Nombre;
            checkStatus.IsChecked = turnosToSave.Estatus;
        }
Example #22
0
        private void AgregarTurnos()
        {
            DateTime horaTurno = DateTime.Parse(GrdHora.SelectedRows[0].Cells[0].Value.ToString());

            Turnos turno = new Turnos(DateTime.Parse(monthCalendarTurno.SelectionStart.ToString()), horaTurno, idMedico, txtPaciente.Text, especialidad, Convert.ToInt16(cmbPracticas.SelectedValue.ToString()), obraSocial);

            turno.Save();
        }
Example #23
0
        public ActionResult DeleteConfirmed(int id)
        {
            Turnos turnos = db.Turnos.Find(id);

            db.Turnos.Remove(turnos);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #24
0
 public IActionResult Create([FromBody] Turnos item)
 {
     if (item == null)
     {
         return(BadRequest());
     }
     _repo.Add(item);
     return(CreatedAtRoute("GetTurnos", new { controller = "Turnos", id = item.TurnoId }, item));
 }
Example #25
0
        public void ValidaAltaTurnoDerivado()
        {
            //Arrange: Se declaran dos tipos de turnos, pacientes internos de la clinica y pacientes derivados de otra clínica.
            Turnos        turnoDerivado = new Turnos("SubjectTest", "Extern_Patient", "SubjectTest", "Extern_Especialist", "Psicologo", false, 2, 1);
            List <Turnos> ListaTurnos   = new List <Turnos>();

            //Act: Efectua el método de almacenar los turnos a la clínica. Assert: Se valida el alta exitoso de los turnos.
            Assert.IsTrue(Clinica.SumoTurno(ListaTurnos, turnoDerivado));
        }
 public MateriaAlumno(MateriaAlumno materia)
 {
     this.id     = materia.Id;
     this.nombre = materia.Nombre;
     this.nota   = materia.Nota;
     this.dia    = materia.Dia;
     this.turno  = materia.Turno;
     this.status = materia.Status;
 }
 public MateriaAlumno(int id, string nombre, Dias dia, Turnos turno)
 {
     this.id     = id;
     this.nombre = nombre;
     this.nota   = 0;
     this.dia    = dia;
     this.turno  = turno;
     this.status = StatusMateria.Cursando;
 }
        private async void TxtPass_OnCustomKeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == Convert.ToChar(Keys.Enter))
            {
                MensajeEspera.ShowWait("Iniciando...");

                var(rpta, objects) = await NCredenciales.Login(this.usuarioSelected.Celular,
                                                               this.txtPass.Texto, DateTime.Now.ToString("yyyy-MM-dd"));

                if (rpta.Equals("OK"))
                {
                    Credenciales   credencial = (Credenciales)objects[0];
                    MainController main       = MainController.GetInstance();
                    main.Usuario = credencial.Usuario;

                    if (credencial.Usuario.Tipo_usuario.Equals("TRABAJADOR CARTERAS"))
                    {
                        Turnos turno = (Turnos)objects[1];
                        main.Turno    = turno;
                        main.Id_cobro = turno.Id_cobro;
                        main.Cobro    = turno.Cobro;

                        FrmObservarArticulos frmArticulos = new FrmObservarArticulos
                        {
                            StartPosition = FormStartPosition.CenterScreen,
                            WindowState   = FormWindowState.Maximized,
                        };
                        frmArticulos.Show();
                        //frmArticulos.LoadArticulos(dtArticulos);
                        this.Hide();
                    }
                    else
                    {
                        DataTable dtSolicitudes = (DataTable)objects[1];
                        DataTable dtCobros      = (DataTable)objects[2];

                        FrmPrincipal FrmPrincipal = new FrmPrincipal
                        {
                            StartPosition = FormStartPosition.CenterScreen,
                            WindowState   = FormWindowState.Maximized,
                        };
                        FrmPrincipal.LoadCobros(dtCobros);
                        FrmPrincipal.LoadNotificaciones(dtSolicitudes);
                        FrmPrincipal.Show();
                        //FrmEstadisticasCobro.LoadArticulos(dtArticulos);
                        this.Hide();
                    }
                }
                else
                {
                    MensajeEspera.CloseForm();
                    Mensajes.MensajeInformacion(rpta, "Entendido");
                }

                MensajeEspera.CloseForm();
            }
        }
        // PUT: api/Turnos
        public void Put([FromBody] Turnos Datos)
        {
            if (Datos == null)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            ClassBD.ActualizarTurno(Datos);
        }
        public static void GenerarEntradaDeRuedas()
        {
            Evento.ruedas     += ruedas;
            Evento.relojActual = relojProxLllegada;

            ColocadoresDeRuedas.AlertarLlegadaDeRuedas();
            Turnos.Contar();
            GenerarProxLlegada();
        }