Exemplo n.º 1
0
        /// <summary>
        ///
        /// Almacen del Appoiment
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void asignarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (frmShiftAppointment frm = new frmShiftAppointment())
            {
                AppointmentBE app = new AppointmentBE();
                frm.Profesional         = profesional;
                frm.State               = Fwk.Bases.EntityUpdateEnum.NEW;
                app.Status              = (int)AppoimantsStatus_SP.Reservado;
                app.ResourceId          = profesional.IdProfesional;
                app.HealthInstitutionId = Controller.CurrentHealthInstitution.HealthInstitutionId;

                DateTime            date = Fwk.HelperFunctions.DateFunctions.GetStartDateTime(this.Date);
                List <TimespamView> wTimespamViewList = null;
                try
                {
                    wTimespamViewList = GetSelectedShifts();
                }
                catch (Exception ex)
                {
                    this.ExceptionViewer.Show(ex);
                    return;
                }
                app.Start    = date.Add(wTimespamViewList[0].Time);
                app.Duration = wTimespamViewList[0].Duration;
                if (wTimespamViewList.Count > 1)
                {
                    app.End = date.Add(wTimespamViewList[wTimespamViewList.Count - 1].Time);
                }
                else
                {
                    app.End = date.Add(wTimespamViewList[0].Time).AddMinutes(wTimespamViewList[0].Duration);
                }

                frm.currentApt = app;
                frm.Refresh();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    ///todo: analizar como crear grupos de turnos
                    foreach (TimespamView timeView in wTimespamViewList)
                    {
                        timeView.Appointment = app;
                    }
                    try
                    {
                        Controller.CreateAppointments(app);
                        if (OnCreateAppoimentsEvent != null)
                        {
                            OnCreateAppoimentsEvent(app, new EventArgs());
                        }
                    }

                    catch (Exception ex)
                    {
                        this.ExceptionViewer.Show(ex);
                    }
                    gridControl2.RefreshDataSource();
                    gridView2.RefreshData();
                }
            }
        }
Exemplo n.º 2
0
        private void gridView2_DoubleClick(object sender, EventArgs e)
        {
            //Esta siendo consultado por un medico
            //if (profesional.IdProfesional != null && profesional.IdProfesion.Value.Equals((int)RubroProfesionalEnum.Medico))
            //{
            //    if (SelectedAppointment.Status == (int)AppoimantsStatus_SP.Reservado)
            //    {
            //        //Actualizar el estado a En atencion
            //        UpdateStatus(AppoimantsStatus_SP.EnAtencion);
            //    }
            //}
            //else
            //{
            if (SelectedAppointment == null)
            {
                return;
            }
            ///Ver - consultar
            using (frmShiftAppointment frm = new frmShiftAppointment())
            {
                frm.State = Fwk.Bases.EntityUpdateEnum.NONE;

                //Este caso se presenta cuando la consulta no es por medio del mismo profesional
                //sino de una secretaria que ve turnos de varios
                //profesionales
                frm.Profesional = new Profesional_FullViewBE();

                frm.AceptCancelButtonBar_Visible = false;
                if (this.profesional == null)
                {
                    //Busco el profesional
                    this.profesional = ServiceCalls.GetProfesional(SelectedAppointment.ResourceId, false, false, false).BusinessData.profesional;
                    //Relleno frm.profesional con info minima
                    frm.Profesional.Nombre             = this.profesional.Persona.Nombre;
                    frm.Profesional.Apellido           = this.profesional.Persona.Apellido;
                    frm.Profesional.IdEspecialidad     = this.profesional.IdEspecialidad;
                    frm.Profesional.NombreEspecialidad = this.profesional.NombreEspecialidad;
                    frm.Profesional.IdProfesion        = this.profesional.IdProfesion;
                }
                else
                {
                    frm.Profesional.Nombre             = this.profesional.Persona.Nombre;
                    frm.Profesional.Apellido           = this.profesional.Persona.Apellido;
                    frm.Profesional.IdEspecialidad     = this.profesional.IdEspecialidad;
                    frm.Profesional.NombreEspecialidad = this.profesional.NombreEspecialidad;
                    frm.Profesional.IdProfesion        = this.profesional.IdProfesion;
                }


                frm.currentApt = SelectedAppointment;
                frm.Refresh();
                frm.ShowDialog();
            }
            //}
        }
Exemplo n.º 3
0
        private void m_sobreturnoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (frmShiftAppointment frm = new frmShiftAppointment())
            {
                AppoimantsStatus_SP_type status = (AppoimantsStatus_SP_type)m_sobreturnoToolStripMenuItem.Tag;

                AppointmentBE app = SelectedTimespamView.Appointment.Clone <AppointmentBE>();
                app.Subject       = string.Concat(Enum.GetName(typeof(AppoimantsStatus_SP_type), status), " a las : ", SelectedTimespamView.Appointment.TimeEnd);
                app.Status        = (int)AppoimantsStatus_SP.Reservado;
                app.IsExceptional = true;

                frm.Profesional = profesional;
                frm.State       = Fwk.Bases.EntityUpdateEnum.NEW;

                app.ResourceId          = profesional.IdProfesional;
                app.HealthInstitutionId = Controller.CurrentHealthInstitution.HealthInstitutionId;
                app.CreationDate        = System.DateTime.Now;
                //DateTime date = Fwk.HelperFunctions.DateFunctions.GetStartDateTime(this.Date);
                //List<TimespamView> wTimespamViewList = null;

                //app.Start = date.Add(wTimespamViewList[0].Time);
                //app.Duration = wTimespamViewList[0].Duration;
                //if (wTimespamViewList.Count > 1)
                //    app.End = date.Add(wTimespamViewList[wTimespamViewList.Count - 1].Time);
                //else
                //    app.End = date.Add(wTimespamViewList[0].Time).AddMinutes(wTimespamViewList[0].Duration);

                frm.currentApt = app;
                frm.Refresh();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        Controller.CreateAppointments(app);
                        if (OnCreateAppoimentsEvent != null)
                        {
                            OnCreateAppoimentsEvent(app, new EventArgs());
                        }
                    }

                    catch (Exception ex)
                    {
                        this.ExceptionViewer.Show(ex);
                    }
                    //gridControl2.RefreshDataSource();
                    //gridView2.RefreshData();
                }
            }
            Refresh();
            //UpdateStatus((AppoimantsStatus_SP)m_sobreturnoToolStripMenuItem.Tag);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 
        /// Almacen del Appoiment
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void asignarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (frmShiftAppointment frm = new frmShiftAppointment())
            {
                AppointmentBE app = new AppointmentBE();
                frm.Profesional = profesional;
                frm.State = Fwk.Bases.EntityUpdateEnum.NEW;
                app.Status = (int)AppoimantsStatus_SP.Reservado;
                app.ResourceId = profesional.IdProfesional;
                app.HealthInstitutionId = ServiceCalls.CurrentHealthInstitution.HealthInstitutionId;

                DateTime date = Fwk.HelperFunctions.DateFunctions.GetStartDateTime(this.Date);
                List<TimespamView> wTimespamViewList = null;
                try
                {
                    wTimespamViewList = GetSelectedShifts();
                }
                catch (Exception ex)
                {
                    this.ExceptionViewer.Show(ex);
                    return;
                }
                app.Start = date.Add(wTimespamViewList[0].Time);
                app.Duration = wTimespamViewList[0].Duration;
                if (wTimespamViewList.Count > 1)
                    app.End = date.Add(wTimespamViewList[wTimespamViewList.Count - 1].Time);
                else
                    app.End = date.Add(wTimespamViewList[0].Time).AddMinutes(wTimespamViewList[0].Duration);

                frm.currentApt = app;
                frm.Refresh();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    ///todo: analizar como crear grupos de turnos
                    foreach (TimespamView timeView in wTimespamViewList)
                    {
                        timeView.Appointment = app;
                    }
                    try
                    {
                        ServiceCalls.CreateAppointments(app);
                        if (OnCreateAppoimentsEvent != null)
                            OnCreateAppoimentsEvent(app, new EventArgs());
                    }

                    catch (Exception ex)
                    {
                        this.ExceptionViewer.Show(ex);
                    }
                    gridControl2.RefreshDataSource();
                    gridView2.RefreshData();
                }

            }
        }
Exemplo n.º 5
0
        private void m_sobreturnoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (frmShiftAppointment frm = new frmShiftAppointment())
            {
                AppoimantsStatus_SP_type status = (AppoimantsStatus_SP_type)m_sobreturnoToolStripMenuItem.Tag;

                AppointmentBE app = SelectedTimespamView.Appointment.Clone<AppointmentBE>();
                app.Subject = string.Concat(Enum.GetName(typeof(AppoimantsStatus_SP_type), status), " a las : ", SelectedTimespamView.Appointment.TimeEnd);
                app.Status =(int) AppoimantsStatus_SP.Reservado;
                app.IsExceptional = true;

                frm.Profesional = profesional;
                frm.State = Fwk.Bases.EntityUpdateEnum.NEW;
                
                app.ResourceId = profesional.IdProfesional;
                app.HealthInstitutionId = ServiceCalls.CurrentHealthInstitution.HealthInstitutionId;
                app.CreationDate = System.DateTime.Now;
                //DateTime date = Fwk.HelperFunctions.DateFunctions.GetStartDateTime(this.Date);
                //List<TimespamView> wTimespamViewList = null;
               
                //app.Start = date.Add(wTimespamViewList[0].Time);
                //app.Duration = wTimespamViewList[0].Duration;
                //if (wTimespamViewList.Count > 1)
                //    app.End = date.Add(wTimespamViewList[wTimespamViewList.Count - 1].Time);
                //else
                //    app.End = date.Add(wTimespamViewList[0].Time).AddMinutes(wTimespamViewList[0].Duration);

                frm.currentApt = app;
                frm.Refresh();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    
                   
                    try
                    {
                        ServiceCalls.CreateAppointments(app);
                        if (OnCreateAppoimentsEvent != null)
                            OnCreateAppoimentsEvent(app, new EventArgs());
                    }

                    catch (Exception ex)
                    {
                        this.ExceptionViewer.Show(ex);
                    }
                    //gridControl2.RefreshDataSource();
                    //gridView2.RefreshData();
                }

            }
            Refresh();
            //UpdateStatus((AppoimantsStatus_SP)m_sobreturnoToolStripMenuItem.Tag);

        }
Exemplo n.º 6
0
        private void gridView2_DoubleClick(object sender, EventArgs e)
        {
            //Esta siendo consultado por un medico
            //if (profesional.IdProfesional != null && profesional.IdProfesion.Value.Equals((int)RubroProfesionalEnum.Medico))
            //{
            //    if (SelectedAppointment.Status == (int)AppoimantsStatus_SP.Reservado)
            //    {
            //        //Actualizar el estado a En atencion
            //        UpdateStatus(AppoimantsStatus_SP.EnAtencion);
            //    }
            //}
            //else
            //{
            if (SelectedAppointment == null) return;
            ///Ver - consultar
            using (frmShiftAppointment frm = new frmShiftAppointment())
            {
                frm.State = Fwk.Bases.EntityUpdateEnum.NONE;
               
                //Este caso se presenta cuando la consulta no es por medio del mismo profesional 
                //sino de una secretaria que ve turnos de varios 
                //profesionales
                frm.Profesional = new Profesional_FullViewBE();

                frm.AceptCancelButtonBar_Visible = false;
                if (this.profesional == null)
                {

                    //Busco el profesional
                    this.profesional = ServiceCalls.GetProfesional(SelectedAppointment.ResourceId, false, false,false).BusinessData.profesional;
                    //Relleno frm.profesional con info minima
                    frm.Profesional.Nombre = this.profesional.Persona.Nombre;
                    frm.Profesional.Apellido = this.profesional.Persona.Apellido;
                    frm.Profesional.IdEspecialidad = this.profesional.IdEspecialidad;
                    frm.Profesional.NombreEspecialidad = this.profesional.NombreEspecialidad;
                    frm.Profesional.IdProfesion = this.profesional.IdProfesion;


                }
                else
                {
                    frm.Profesional.Nombre = this.profesional.Persona.Nombre;
                    frm.Profesional.Apellido = this.profesional.Persona.Apellido;
                    frm.Profesional.IdEspecialidad = this.profesional.IdEspecialidad;
                    frm.Profesional.NombreEspecialidad = this.profesional.NombreEspecialidad;
                    frm.Profesional.IdProfesion = this.profesional.IdProfesion;
                }


                frm.currentApt = SelectedAppointment;
                frm.Refresh();
                frm.ShowDialog();
            }
            //}
        }
Exemplo n.º 7
0
 private void gridView2_DoubleClick(object sender, EventArgs e)
 {
   
     if (SelectedAppointment == null) return;
     ///Ver - consultar
     using (frmShiftAppointment frm = new frmShiftAppointment())
     {
         frm.State = Fwk.Bases.EntityUpdateEnum.NONE;
         
         //Este caso se presenta cuando la consulta no es por medio del mismo profesional 
         //sino de una secretaria que ve turnos de varios 
         //profesionales
         frm.Profesional = new Profesional_FullViewBE();
         frm.Profesional.Nombre = Controller.CurrentProfesional.Persona.Nombre;
         frm.Profesional.Apellido = Controller.CurrentProfesional.Persona.Apellido;
         frm.Profesional.IdEspecialidad = Controller.CurrentProfesional.IdEspecialidad;
         frm.Profesional.NombreEspecialidad = Controller.CurrentProfesional.NombreEspecialidad;
         frm.Profesional.IdProfesion = Controller.CurrentProfesional.IdProfesion;
         frm.AceptCancelButtonBar_Visible = false;
         frm.currentApt = SelectedAppointment.Get_Appointments();
         frm.Refresh();
         frm.ShowDialog();
     }
  
 }