private void btnEditarESO_Click(object sender, EventArgs e) { Form frm; int TserviceId = int.Parse(grdDataService.Selected.Rows[0].Cells["i_ServiceId"].Value.ToString()); if (TserviceId == (int)MasterService.AtxMedicaParticular) { frm = new Operations.frmMedicalConsult(_serviceId, null, null); frm.ShowDialog(); } else { this.Enabled = false; frm = new Operations.frmEso(_serviceId, null, "Service"); frm.ShowDialog(); this.Enabled = true; } }
private void Atender() { OperationResult objOperationResult = new OperationResult(); ServiceBL objServiceBL = new ServiceBL(); servicecomponentDto objservicecomponentDto = new servicecomponentDto(); List <ServiceComponentList> ListServiceComponent = new List <ServiceComponentList>(); _ServiceComponentId = new List <string>(); if (chkVerificarHuellaDigital.Checked) { var checkingFinger = new frmCheckingFinger(); checkingFinger._PacientId = _personId; checkingFinger.ShowDialog(); if (checkingFinger.DialogResult == DialogResult.Cancel) { return; } } DialogResult Result = MessageBox.Show("¿Está seguro de INICIAR ATENCIÓN este registro?", "ADVERTENCIA!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (_categoryId == -1) { _ServiceComponentId.Add(grdListaLlamando.Selected.Rows[0].Cells["v_ServiceComponentId"].Value.ToString()); } else { foreach (var item in objServiceBL.GetServiceComponentByCategoryId(ref objOperationResult, _categoryId, _serviceId)) { _ServiceComponentId.Add(item.v_ServiceComponentId); } } if (Result == System.Windows.Forms.DialogResult.Yes) { for (int i = 0; i < _ServiceComponentId.Count(); i++) { objservicecomponentDto = objServiceBL.GetServiceComponent(ref objOperationResult, _ServiceComponentId[i]); objservicecomponentDto.i_QueueStatusId = (int)Common.QueueStatusId.OCUPADO; objservicecomponentDto.d_StartDate = DateTime.Now; objServiceBL.UpdateServiceComponent(ref objOperationResult, objservicecomponentDto, Globals.ClientSession.GetAsList()); } //Actualizar grdDataServiceComponent string strServicelId = grdListaLlamando.Selected.Rows[0].Cells[5].Value.ToString(); ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, strServicelId); grdDataServiceComponent.DataSource = ListServiceComponent; _Flag = 1; Form frm; if (_TserviceId == (int)MasterService.AtxMedicaParticular) { frm = new Operations.frmMedicalConsult(_serviceId, string.Join("|", _componentIds.Select(p => p)), null); frm.ShowDialog(); } else { this.Enabled = false; frm = new Operations.frmEso(_serviceId, string.Join("|", _componentIds.Select(p => p)), null); frm.ShowDialog(); this.Enabled = true; // Aviso automático de que se culminaron todos los examanes, se tendria que proceder // a establecer el estado del servicio a (Culminado Esperando Aptitud) var alert = objServiceBL.GetServiceComponentsCulminados(ref objOperationResult, _serviceId); if (alert != null && alert.Count > 0) { } else { MessageBox.Show("Todos los Examenes se encuentran concluidos.\nEl estado de la Atención es: En espera de Aptitud .", "INFORMACIÓN!", MessageBoxButtons.OK, MessageBoxIcon.Information); serviceDto objserviceDto = new serviceDto(); objserviceDto = objServiceBL.GetService(ref objOperationResult, objservicecomponentDto.v_ServiceId); objserviceDto.i_ServiceStatusId = (int)ServiceStatus.EsperandoAptitud; objserviceDto.v_Motive = "Esperando Aptitud"; objServiceBL.UpdateService(ref objOperationResult, objserviceDto, Globals.ClientSession.GetAsList()); } } // refrecar la grilla ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _serviceId); grdDataServiceComponent.DataSource = ListServiceComponent; } }