示例#1
0
        private void BindGrid()
        {
            CalendarBL  objCalendarBL  = new CalendarBL();
            calendarDto objcalendarDto = new calendarDto();
            PacientBL   objPacientBL   = new PacientBL();
            PacientList objPacientDto  = new PacientList();

            OperationResult objOperationResult = new OperationResult();

            var objData = GetData(0, null, "", strFilterExpression);

            //Validar que el trabajador exista en el sistema
            objPacientDto = objPacientBL.GetPacient(ref objOperationResult, null, txtDocNumber.Text.Trim());
            //_CalendarId = objData[0].v_CalendarId;
            if (objPacientDto == null)
            {
                MessageBox.Show("Este Trabajador no está ingresado en el sistema SIGESOFT.", "NO SE ENCONTRÓ TRABAJADOR!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            string Pacient = objPacientDto.v_FirstName + " " + objPacientDto.v_FirstLastName + " " + objPacientDto.v_SecondLastName;

            if (objData.Count == 0)
            {
                MessageBox.Show("El trabajado " + Pacient + " no está agendado. Comuníquese con el área de Recepción.", "NO SE ENCONTRÓ CITA!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (objData[0].i_CalendarStatusId == (int)CalendarStatus.Cancelado)
                {
                    MessageBox.Show("La cita del trabajor " + Pacient + " ha sido cancelada. Comuníquese con el área de recepción.", "¡INFORMACIÓN!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (objData[0].i_CalendarStatusId != (int)CalendarStatus.Agendado)
                {
                    MessageBox.Show("El trabajor " + Pacient + " ya está dentro del Centro Médico.", "¡INFORMACIÓN!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                DialogResult Result = MessageBox.Show("¿Desea registar el ingreso de " + Pacient + " al centro médico?", "TRABAJADOR AGENDADO!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (Result == System.Windows.Forms.DialogResult.Yes)
                {
                    foreach (var item in objData)
                    {
                        objcalendarDto = objCalendarBL.GetCalendar(ref objOperationResult, item.v_CalendarId);
                        objcalendarDto.d_EntryTimeCM = DateTime.Now;

                        objcalendarDto.i_CalendarStatusId = (int)CalendarStatus.Ingreso;
                        objCalendarBL.UpdateCalendar(ref objOperationResult, objcalendarDto, Globals.ClientSession.GetAsList());
                    }
                }
                _objLista                    = _objCalendarBL.GetCalendarsPagedAndFiltered1(ref objOperationResult, 0, null, "i_CalendarStatusId ASC , d_EntryTimeCM ASC", null, DateTime.Now.Date, DateTime.Now.Date.AddDays(1));
                grdData.DataSource           = _objLista;
                lblRecordCountTotal.Text     = "Total : " + _objLista.Count.ToString();
                lblRecordCountPendiente.Text = "Pendientes : " + _objLista.FindAll(p => p.i_CalendarStatusId == (int)CalendarStatus.Agendado).Count();
            }
        }
示例#2
0
        private void mnuFinCircuito_Click(object sender, EventArgs e)
        {
            CalendarBL      objCalendarBL      = new CalendarBL();
            calendarDto     objCalendarDto     = new calendarDto();
            OperationResult objOperationResult = new OperationResult();

            DialogResult Result = MessageBox.Show("¿Está seguro de TERMINAR CIRCUITO este registro?", "ADVERTENCIA!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (Result == System.Windows.Forms.DialogResult.Yes)
            {
                string strCalendarId = grdDataCalendar.Selected.Rows[0].Cells[0].Value.ToString();

                objCalendarDto = objCalendarBL.GetCalendar(ref objOperationResult, strCalendarId);
                objCalendarDto.v_CalendarId   = strCalendarId;
                objCalendarDto.i_LineStatusId = (int)Common.LineStatus.FueraCircuito;

                objCalendarBL.UpdateCalendar(ref objOperationResult, objCalendarDto, Globals.ClientSession.GetAsList());

                btnFilter_Click(sender, e);
            }
        }
示例#3
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            CalendarBL      objCalendarBL      = new CalendarBL();
            OperationResult objOperationResult = new OperationResult();


            List <MyListWeb> ListaServicios = (List <MyListWeb>)Session["objLista"];

            if (ListaServicios == null)
            {
                Alert.Show("Seleccione un registro");
                return;
            }
            else
            {
                foreach (var item in ListaServicios)
                {
                    calendarDto objCalendarDto = new calendarDto();

                    objCalendarDto = objCalendarBL.GetCalendar(ref objOperationResult, item.CalendarId);
                    objCalendarDto.v_CalendarId       = item.CalendarId;
                    objCalendarDto.i_CalendarStatusId = 4; //Cancelado
                    objCalendarDto.i_LineStatusId     = 2; //Fuera de Circuito

                    objCalendarBL.UpdateCalendar(ref objOperationResult, objCalendarDto, ((ClientSession)Session["objClientSession"]).GetAsList());
                }

                //Analizar el resultado de la operación
                if (objOperationResult.Success == 1)  // Operación sin error
                {
                    // Cerrar página actual y hacer postback en el padre para actualizar
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else  // Operación con error
                {
                    Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage);
                    // Se queda en el formulario.
                }
            }
        }
示例#4
0
        private void btnUpdateandSelect_Click(object sender, EventArgs e)
        {
            CalendarBL      objCalendarBL      = new CalendarBL();
            calendarDto     objcalendarDto     = new calendarDto();
            OperationResult objOperationResult = new OperationResult();


            for (int i = 0; i < _objLista.Count; i++)
            {
                if (_DocNumber == _objLista[i].v_DocNumber)
                {
                    objcalendarDto = objCalendarBL.GetCalendar(ref objOperationResult, _objLista[i].v_CalendarId);


                    objcalendarDto.d_EntryTimeCM      = (DateTime?)null;
                    objcalendarDto.i_CalendarStatusId = (int)CalendarStatus.Agendado;
                    objCalendarBL.UpdateCalendar(ref objOperationResult, objcalendarDto, Globals.ClientSession.GetAsList());
                }
            }
            _objLista                    = _objCalendarBL.GetCalendarsPagedAndFiltered1(ref objOperationResult, 0, null, "i_CalendarStatusId ASC , d_EntryTimeCM ASC", null, DateTime.Now.Date, DateTime.Now.Date.AddDays(1));
            grdData.DataSource           = _objLista;
            lblRecordCountTotal.Text     = "Total : " + _objLista.Count.ToString();
            lblRecordCountPendiente.Text = "Pendientes : " + _objLista.FindAll(p => p.i_CalendarStatusId == (int)CalendarStatus.Agendado).Count();
        }
示例#5
0
        private void Liberar()
        {
            try
            {
                OperationResult objOperationResult = new OperationResult();
                ServiceBL       objServiceBL       = new ServiceBL();

                servicecomponentDto         objservicecomponentDto = null;
                List <ServiceComponentList> ListServiceComponent   = new List <ServiceComponentList>();

                if (_categoryId == -1)
                {
                    _ServiceComponentId.Add(grdLlamandoPaciente.Selected.Rows[0].Cells["v_ServiceComponentId"].Value.ToString());
                }
                else
                {
                    var servCompCat = objServiceBL.GetServiceComponentByCategoryId(ref objOperationResult, _categoryId, _serviceId);

                    foreach (var item in servCompCat)
                    {
                        _ServiceComponentId.Add(item.v_ServiceComponentId);
                    }
                }

                List <servicecomponentDto> list = new List <servicecomponentDto>();

                for (int i = 0; i < _ServiceComponentId.Count; i++)
                {
                    objservicecomponentDto = new servicecomponentDto();
                    objservicecomponentDto.v_ServiceComponentId = _ServiceComponentId[i];
                    objservicecomponentDto.i_QueueStatusId      = (int)Common.QueueStatusId.LIBRE;
                    objservicecomponentDto.i_Iscalling          = (int)SiNo.NO;
                    objservicecomponentDto.d_EndDate            = DateTime.Now;
                    list.Add(objservicecomponentDto);
                }

                // update
                objServiceBL.UpdateServiceComponentOffice(list);

                #region Check de salir de circuito

                if (chkHability.Checked == true) // finaliza el servicio y actualiza el estado del servicio
                {
                    if (ddlServiceStatusId.SelectedValue.ToString() == ((int)ServiceStatus.Iniciado).ToString())
                    {
                        MessageBox.Show("Debe elegir cualquier otro estado que no sea (Iniciado)\nSi desea Liberar y/o Finalizar Circuito.", "ADVERTENCIA!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    serviceDto objserviceDto = new serviceDto();

                    objserviceDto.v_ServiceId       = _serviceId;
                    objserviceDto.i_ServiceStatusId = int.Parse(ddlServiceStatusId.SelectedValue.ToString());
                    objserviceDto.v_Motive          = txtReason.Text;

                    objServiceBL.UpdateServiceOffice(ref objOperationResult, objserviceDto, Globals.ClientSession.GetAsList());

                    //Actualizamos el estado de la linea de la agenda como fuera de circuito
                    CalendarBL  objCalendarBL  = new CalendarBL();
                    calendarDto objcalendarDto = new calendarDto();
                    objcalendarDto = objCalendarBL.GetCalendar(ref objOperationResult, _CalendarId);
                    objcalendarDto.i_LineStatusId = 2;// int.Parse(Common.LineStatus.FueraCircuito.ToString());
                    objCalendarBL.UpdateCalendar(ref objOperationResult, objcalendarDto, Globals.ClientSession.GetAsList());
                }

                #endregion

                //Actualizar grdDataServiceComponent

                ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _serviceId);
                grdDataServiceComponent.DataSource = ListServiceComponent;

                btnRefresh_Click(null, null);

                txtReason.Text              = "";
                grdListaLlamando.Enabled    = true;
                grdLlamandoPaciente.Enabled = false;
                btnRefresh.Enabled          = true;
                chkHability.Enabled         = false;
                chkHability.Checked         = false;
                groupBox3.Enabled           = false;

                grdLlamandoPaciente.DataSource = new List <CalendarList>();
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Utils.ExceptionFormatter(ex), "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#6
0
        private void Liberar()
        {
            try
            {
                OperationResult objOperationResult = new OperationResult();
                ServiceBL       objServiceBL       = new ServiceBL();
                _ServiceComponentId = new List <string>();

                servicecomponentDto         objservicecomponentDto = null;
                List <ServiceComponentList> ListServiceComponent   = new List <ServiceComponentList>();


                if (grdDataServiceComponent.Rows.Count() == 0)
                {
                    MessageBox.Show("Debe seleccionar un paciente para poder LIBERARLO", "ADVERTENCIA!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (_categoryId == -1)
                {
                    _ServiceComponentId.Add(grdLlamandoPaciente.Selected.Rows[0].Cells["v_ServiceComponentId"].Value.ToString());
                }
                else
                {
                    var servCompCat = objServiceBL.GetServiceComponentByCategoryId(ref objOperationResult, _categoryId, _serviceId);

                    foreach (var item in servCompCat)
                    {
                        _ServiceComponentId.Add(item.v_ServiceComponentId);
                    }
                }

                List <servicecomponentDto> list = new List <servicecomponentDto>();

                for (int i = 0; i < _ServiceComponentId.Count; i++)
                {
                    objservicecomponentDto = new servicecomponentDto();
                    objservicecomponentDto.v_ServiceComponentId       = _ServiceComponentId[i];
                    objservicecomponentDto.i_QueueStatusId            = (int)Common.QueueStatusId.LIBRE;
                    objservicecomponentDto.i_Iscalling                = (int)SiNo.NO;
                    objservicecomponentDto.i_Iscalling_1              = (int)SiNo.NO;
                    objservicecomponentDto.d_EndDate                  = DateTime.Now;
                    objservicecomponentDto.i_ServiceComponentStatusId = (int)Common.ServiceComponentStatus.PorAprobacion;



                    list.Add(objservicecomponentDto);
                    //Buscar en la lista y reemplazar el i_QueueStatusId

                    foreach (var item in _objCalendarListAMC.Where(c => c.v_ServiceComponentId == _ServiceComponentId[i]))
                    {
                        item.i_QueueStatusId = (int)Common.QueueStatusId.LIBRE;
                    }
                }

                // update
                if (_componentName == "LABORATORIO")
                {
                    objServiceBL.UpdateServiceComponentOfficeLaboratorio(list);
                }
                else
                {
                    objServiceBL.UpdateServiceComponentOffice(list);
                }


                #region Check de salir de circuito

                if (chkHability.Checked == true) // finaliza el servicio y actualiza el estado del servicio
                {
                    if (ddlServiceStatusId.SelectedValue.ToString() == ((int)ServiceStatus.Iniciado).ToString())
                    {
                        MessageBox.Show("Debe elegir cualquier otro estado que no sea (Iniciado)\nSi desea Liberar y/o Finalizar Circuito.", "ADVERTENCIA!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }

                    serviceDto objserviceDto = new serviceDto();

                    objserviceDto.v_ServiceId       = _serviceId;
                    objserviceDto.i_ServiceStatusId = int.Parse(ddlServiceStatusId.SelectedValue.ToString());
                    objserviceDto.v_Motive          = txtReason.Text;

                    objServiceBL.UpdateServiceOffice(ref objOperationResult, objserviceDto, Globals.ClientSession.GetAsList());

                    //Actualizamos el estado de la linea de la agenda como fuera de circuito
                    CalendarBL  objCalendarBL  = new CalendarBL();
                    calendarDto objcalendarDto = new calendarDto();
                    objcalendarDto = objCalendarBL.GetCalendar(ref objOperationResult, _CalendarId);
                    objcalendarDto.i_LineStatusId = 2;// int.Parse(Common.LineStatus.FueraCircuito.ToString());
                    objCalendarBL.UpdateCalendar(ref objOperationResult, objcalendarDto, Globals.ClientSession.GetAsList());
                }

                #endregion

                //Actualizar grdDataServiceComponent

                ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _serviceId);
                grdDataServiceComponent.DataSource = ListServiceComponent;

                btnRefresh_Click(null, null);

                txtReason.Text           = "";
                grdListaLlamando.Enabled = true;
                //grdLlamandoPaciente.Enabled = false;
                btnRefresh.Enabled  = true;
                chkHability.Enabled = false;
                chkHability.Checked = false;
                groupBox3.Enabled   = false;

                List <CalendarList> GrillaVacia = new List <CalendarList>();
                grdLlamandoPaciente.DataSource = GrillaVacia;

                _objCalendarListAMC.RemoveAll(x => x.i_QueueStatusId == 1);
                grdLlamandoPaciente.DataSource = _objCalendarListAMC;
                //grdLlamandoPaciente.DataSource = _objCalendarListAMC.FindAll(p => p.i_QueueStatusId != 1);

                //grdLlamandoPaciente.DataSource = new List<CalendarList>();

                if (_objCalendarListAMC.Count == 0)
                {
                    if (_objCalendarListAMC.Count > 0)
                    {
                        grdLlamandoPaciente.Rows[0].Selected = true;
                    }

                    btnRellamar.Enabled                 = false;
                    btnAtenderVerServicio.Enabled       = false;
                    btnLiberarFinalizarCircuito.Enabled = false;
                    grdLlamandoPaciente.Enabled         = false;
                    //grdLlamandoPaciente_Click(null, null);
                }

                else
                {
                    grdLlamandoPaciente.Rows[0].Selected = true;
                }

                //grdLlamandoPaciente.DataSource = new List<CalendarList>();
            }
            catch (Exception ex)
            {
                MessageBox.Show(Common.Utils.ExceptionFormatter(ex), "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }