private void ultraGridPolicyMetrics_MouseClick(object sender, MouseEventArgs e) { if (m_allowEdit && e.Button == MouseButtons.Left) { Infragistics.Win.UIElement selectedElement = ultraGridPolicyMetrics.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y)); if (selectedElement is Infragistics.Win.CheckIndicatorUIElement) { Infragistics.Win.UltraWinGrid.UltraGridRow row = selectedElement.SelectableItem as Infragistics.Win.UltraWinGrid.UltraGridRow; if (row != null && row.Cells != null) { // SQLsecure 3.1 (Anshul Aggarwal) - Type of control decides editable columns in the grid. if (m_ControlType == ConfigurePolicyControlType.ImportExportSecurityCheck) { UltraGridCell cell = selectedElement.GetContext(typeof(UltraGridCell)) as UltraGridCell; if (cell != null && (cell.Column.Key == Utility.Constants.POLICY_METRIC_VALUE_IS_SELECTED)) { cell.Value = !((bool)cell.Value); UpdateEnabledCount(); } } else { Infragistics.Win.UltraWinGrid.UltraGridCell cell = row.Cells[Utility.Constants.POLICY_METRIC_COLUMN_IS_ENABLED]; if (cell != null && cell.Value is bool) { cell.Value = !(bool)cell.Value; UpdateEnabledCount(); } } } } } }
private void grdDataServiceComponent_MouseDown(object sender, MouseEventArgs e) { Point point = new System.Drawing.Point(e.X, e.Y); Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point); if (uiElement == null || uiElement.Parent == null) { return; } Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow)); if (row != null) { grdDataServiceComponent.Rows[row.Index].Selected = true; contextMenuStrip2.Items["btnRemoverEsamen"].Enabled = true; } else { contextMenuStrip2.Items["btnRemoverEsamen"].Enabled = false; } }
private void grdDataCalendar_MouseDown(object sender, MouseEventArgs e) { Point point = new System.Drawing.Point(e.X, e.Y); Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point); if (uiElement == null || uiElement.Parent == null) { return; } Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow)); if (e.Button == MouseButtons.Right) { if (row != null) { _RowIndexgrdDataCalendar = row.Index; grdDataCalendar.Rows[row.Index].Selected = true; int CalendarStatusId = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_CalendarStatusId"].Value.ToString()); int LineStatusId = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_LineStatusId"].Value.ToString()); int ServiceStatusId = int.Parse(grdDataCalendar.Selected.Rows[0].Cells["i_ServiceStatusId"].Value.ToString()); _PacientId = grdDataCalendar.Selected.Rows[0].Cells["v_PersonId"].Value.ToString(); if (CalendarStatusId == (int)Common.CalendarStatus.Agendado) { contextMenuStrip1.Items["mnuCancelCalendar"].Enabled = true; contextMenuStrip1.Items["mnuFinCircuito"].Enabled = false; contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = true; contextMenuStrip1.Items["mnuReagendarCita"].Enabled = true; } else if (CalendarStatusId == (int)Common.CalendarStatus.Atendido) { contextMenuStrip1.Items["mnuCancelCalendar"].Enabled = false; contextMenuStrip1.Items["mnuFinCircuito"].Enabled = true; contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false; contextMenuStrip1.Items["mnuReagendarCita"].Enabled = false; } else if (CalendarStatusId == (int)Common.CalendarStatus.Cancelado) { contextMenuStrip1.Items["mnuCancelCalendar"].Enabled = false; contextMenuStrip1.Items["mnuFinCircuito"].Enabled = false; contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false; contextMenuStrip1.Items["mnuReagendarCita"].Enabled = true; } if (LineStatusId == (int)Common.LineStatus.FueraCircuito && CalendarStatusId == (int)Common.CalendarStatus.Atendido) { contextMenuStrip1.Items["mnuCancelCalendar"].Enabled = false; contextMenuStrip1.Items["mnuFinCircuito"].Enabled = false; contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false; contextMenuStrip1.Items["mnuReagendarCita"].Enabled = false; } OperationResult objOperationResult = new OperationResult(); ServiceBL objServiceBL = new ServiceBL(); List <ServiceComponentList> ListServiceComponent = new List <ServiceComponentList>(); _strServicelId = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString(); ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _strServicelId); grdDataServiceComponent.DataSource = ListServiceComponent; } else { contextMenuStrip1.Items["mnuCancelCalendar"].Enabled = false; contextMenuStrip1.Items["mnuFinCircuito"].Enabled = false; contextMenuStrip1.Items["mnuComenzarCircuito"].Enabled = false; contextMenuStrip1.Items["mnuReagendarCita"].Enabled = false; } } if (e.Button == MouseButtons.Left) { if (row != null) { OperationResult objOperationResult = new OperationResult(); ServiceBL objServiceBL = new ServiceBL(); List <ServiceComponentList> ListServiceComponent = new List <ServiceComponentList>(); PacientBL objPacientBL = new PacientBL(); personDto objpersonDto = new personDto(); _PacientId = grdDataCalendar.Selected.Rows[0].Cells["v_PersonId"].Value.ToString(); //string strServicelId = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString(); _strServicelId = grdDataCalendar.Selected.Rows[0].Cells[5].Value.ToString(); ListServiceComponent = objServiceBL.GetServiceComponents(ref objOperationResult, _strServicelId); grdDataServiceComponent.DataSource = ListServiceComponent; txtTrabajador.Text = grdDataCalendar.Selected.Rows[0].Cells["v_Pacient"].Value.ToString(); if (grdDataCalendar.Selected.Rows[0].Cells["v_WorkingOrganizationName"].Value != null) { WorkingOrganization.Text = grdDataCalendar.Selected.Rows[0].Cells["v_WorkingOrganizationName"].Value.ToString(); } txtProtocol.Text = grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolName"].Value == null ? "" : grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolName"].Value.ToString(); txtService.Text = grdDataCalendar.Selected.Rows[0].Cells["v_ServiceName"].Value.ToString(); if (grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolId"].Value != null) { if (grdDataCalendar.Selected.Rows[0].Cells["v_ProtocolId"].Value.ToString() == Constants.CONSULTAMEDICA) { txtTypeESO.Text = ""; } else { txtTypeESO.Text = grdDataCalendar.Selected.Rows[0].Cells["v_EsoTypeName"].Value.ToString(); } } _personName = grdDataCalendar.Selected.Rows[0].Cells["v_Pacient"].Value.ToString(); objpersonDto = objPacientBL.GetPerson(ref objOperationResult, _PacientId); Byte[] ooo = objpersonDto.b_PersonImage; if (ooo == null) { pbImage.Image = Resources.nofoto; } else { pbImage.Image = Common.Utils.BytesArrayToImageOficce(ooo, pbImage); _personImage = ooo; } // Huella y Firma if (objpersonDto.b_FingerPrintImage == null) { txtExisteHuella.Text = "NO REGISTRADO"; txtExisteHuella.ForeColor = Color.Red; } else { txtExisteHuella.Text = "REGISTRADO"; txtExisteHuella.ForeColor = Color.DarkBlue; } // Firma if (objpersonDto.b_RubricImage == null) { txtExisteFirma.Text = "NO REGISTRADO"; txtExisteFirma.ForeColor = Color.Red; } else { txtExisteFirma.Text = "REGISTRADO"; txtExisteFirma.ForeColor = Color.DarkBlue; } } } }
private void grdDataMedicalExamFieldValue_MouseDown(object sender, MouseEventArgs e) { //if (e.Button == MouseButtons.Right) //{ Point point = new System.Drawing.Point(e.X, e.Y); Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point); if (uiElement == null || uiElement.Parent == null) { return; } Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow)); if (row != null) { grdDataMedicalExamFieldValue.Rows[row.Index].Selected = true; contextMenuMedicalExamFieldValues.Items["mnuGridNewMedicalExamFieldValue"].Enabled = true; contextMenuMedicalExamFieldValues.Items["mnuGridEditMedicalExamFieldValue"].Enabled = true; contextMenuMedicalExamFieldValues.Items["mnuGridDeleteMedicalExamFieldValue"].Enabled = true; } else { contextMenuMedicalExamFieldValues.Items["mnuGridNewMedicalExamFieldValue"].Enabled = true; contextMenuMedicalExamFieldValues.Items["mnuGridEditMedicalExamFieldValue"].Enabled = false; contextMenuMedicalExamFieldValues.Items["mnuGridDeleteMedicalExamFieldValue"].Enabled = false; } //} }
private void grdProtocolComponent_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { Point point = new System.Drawing.Point(e.X, e.Y); Infragistics.Win.UIElement uiElement = ((Infragistics.Win.UltraWinGrid.UltraGridBase)sender).DisplayLayout.UIElement.ElementFromPoint(point); if (uiElement == null || uiElement.Parent == null) { return; } // Capturar valor de una celda especifica al hace click derecho sobre la celda k se quiere su valor Infragistics.Win.UltraWinGrid.UltraGridCell cell = (Infragistics.Win.UltraWinGrid.UltraGridCell)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridCell)); Infragistics.Win.UltraWinGrid.UltraGridRow row = (Infragistics.Win.UltraWinGrid.UltraGridRow)uiElement.GetContext(typeof(Infragistics.Win.UltraWinGrid.UltraGridRow)); if (row != null) { _rowIndexPc = row.Index; if (row.Cells["v_ProtocolComponentId"].Value != null) { _protocolComponentId = row.Cells["v_ProtocolComponentId"].Value.ToString(); } grdProtocolComponent.Rows[_rowIndexPc].Selected = true; cmProtocol.Items["Edit"].Enabled = true; if (_mode == "Edit") { OperationResult objOperationResult = new OperationResult(); var isProtocolInService = _protocolBL.IsExistsProtocol(ref objOperationResult, _protocolId); if (isProtocolInService) { cmProtocol.Items["delete"].Enabled = false; } else { cmProtocol.Items["delete"].Enabled = true; } } else { cmProtocol.Items["delete"].Enabled = true; } } else { cmProtocol.Items["delete"].Enabled = false; cmProtocol.Items["Edit"].Enabled = false; } } }