private void btAccept_Click(object sender, EventArgs e) { if (lvImages.SelectedRowsCount > 0) { try { ImgResult = (Bitmap)lvImages.GetDataRow(lvImages.GetSelectedRows()[0])[0]; Close(); } catch (Exception ex) { int num = (int)XtraMessageBox.Show(ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Hand); } } else { int num1 = (int)XtraMessageBox.Show(Messages.SelectRecord, Messages.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }
public override IList GetSelectedObjects() { if (layoutView == null || DataSource == null) { return new object[0] { } } ; int[] selection = layoutView.GetSelectedRows(); List <object> result = new List <object>(); for (int i = 0; i < selection.Length; i++) { if (layoutView.IsDataRow(selection[i])) { result.Add(((IList)DataSource)[layoutView.GetDataSourceRowIndex(selection[i])]); } } return(result); }
private void btnRandom_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { splitQC.Panel2Collapsed = true; dgvQCList.DataSource = null; if (lView.SelectedRowsCount > 0) { int[] selRows = lView.GetSelectedRows(); DataRowView selRow = (DataRowView)lView.GetRow(selRows[0]); string sSelectedAgentName = selRow["AgentName"].ToString(); string sValidStatus = string.Empty; if (GV.sAccessTo == "TR") { sValidStatus = GV.sTRContactstatusTobeValidated; } else { sValidStatus = GV.sWRContactstatusTobeValidated; } if (sSelectedAgentName.Length > 0) { string sQuery = string.Empty; if (sProcessTable == "Contact") { if (sProcessType == "Fresh") { sQuery = "SELECT TOP 1 A.Master_ID FROM " + GV.sContactTable + " A LEFT JOIN " + GV.sQCTable + " B ON A.CONTACT_ID_P = B.RecordID AND B.TableName='Contact' AND B.ResearchType='" + GV.sAccessTo + "'"; sQuery += " WHERE CAST(A." + GV.sAccessTo + "_UPDATED_DATE AS DATE) = '" + sSelectedDate + "' AND A." + GV.sAccessTo + "_AGENT_NAME='" + sSelectedAgentName + "' AND A." + GV.sAccessTo + "_CONTACT_STATUS IN "; sQuery += " (" + sValidStatus + ") AND B.QC_Sample_Status IS NULL Order By Rand();"; } else { sQuery = "SELECT TOP 1 A.Master_ID FROM " + GV.sContactTable + " A INNER JOIN " + GV.sQCTable + " B ON A.CONTACT_ID_P = B.RecordID AND B.TableName='Contact' AND B.ResearchType='" + GV.sAccessTo + "'"; sQuery += " WHERE CAST(A." + GV.sAccessTo + "_UPDATED_DATE AS DATE) = '" + sSelectedDate + "' AND A." + GV.sAccessTo + "_AGENT_NAME='" + sSelectedAgentName + "' AND B.QC_Status ='Reprocessed'"; sQuery += " Order By Rand();"; } } else { if (sProcessType == "Fresh") { sQuery = "SELECT TOP 1 A.Master_ID FROM " + GV.sCompanyTable + " A LEFT JOIN " + GV.sQCTable + " B ON A.MASTER_ID = B.RecordID AND B.TableName='Company' AND B.ResearchType='" + GV.sAccessTo + "'"; sQuery += " WHERE CAST(A." + sDateColumn + " AS DATE) = '" + sSelectedDate + "' AND A." + GV.sAccessTo + "_AGENTNAME='" + sSelectedAgentName + "' "; sQuery += " AND B.QC_Sample_Status IS NULL Order By Rand();"; } else { sQuery = "SELECT TOP 1 A.Master_ID FROM " + GV.sCompanyTable + " A INNER JOIN " + GV.sQCTable + " B ON A.MASTER_ID = B.RecordID AND B.TableName='Company' AND B.ResearchType='" + GV.sAccessTo + "'"; sQuery += " WHERE CAST(A." + sDateColumn + " AS DATE) = '" + sSelectedDate + "' AND A." + GV.sAccessTo + "_AGENTNAME='" + sSelectedAgentName + "' AND B.QC_Status ='Reprocessed'"; sQuery += " Order By Rand();"; } } System.Data.DataTable dtSampleRecords = GV.MSSQL1.BAL_ExecuteQuery(sQuery); if (dtSampleRecords.Rows.Count > 0) { GM.OpenContactUpdate(dtSampleRecords.Rows[0]["MASTER_ID"].ToString(), false, true, this, null); } } } }