private void superGridControl1_GetCellStyle(object sender, GridGetCellStyleEventArgs e) { if (e.GridCell.GridColumn.DataPropertyName == "SampleCode") { CmcsEquInfSampleBarrel cmcsequinfsamplebarrel = e.GridCell.GridRow.DataItem as CmcsEquInfSampleBarrel; if (cmcsequinfsamplebarrel != null && !string.IsNullOrEmpty(cmcsequinfsamplebarrel.SampleCode)) { e.Style.Background.Color1 = this.dicCellColors[cmcsequinfsamplebarrel.SampleCode]; } } }
/// <summary> /// 选中采样码一致的记录 /// </summary> /// <param name="superGridControl"></param> /// <param name="sampleCode">采样码</param> private void CheckedSameBarrelRow(SuperGridControl superGridControl, string sampleCode) { currentEquInfSampleBarrels.Clear(); this.currentSampleCode = sampleCode; foreach (GridRow gridRow in superGridControl.PrimaryGrid.Rows) { CmcsEquInfSampleBarrel cmcsEquInfSampleBarrel = gridRow.DataItem as CmcsEquInfSampleBarrel; gridRow.Checked = (cmcsEquInfSampleBarrel != null && !string.IsNullOrWhiteSpace(cmcsEquInfSampleBarrel.SampleCode) && !string.IsNullOrWhiteSpace(sampleCode) && cmcsEquInfSampleBarrel.SampleCode == sampleCode); if (gridRow.Checked) { currentEquInfSampleBarrels.Add(cmcsEquInfSampleBarrel); } } }
/// <summary> /// 检查采样罐信息是否已更新 /// </summary> private bool CheckBeltSampleBarrel() { foreach (GridRow gridRow in superGridControl1.PrimaryGrid.Rows) { if (gridRow.Checked) { CmcsEquInfSampleBarrel cmcsEquInfSampleBarrel = gridRow.DataItem as CmcsEquInfSampleBarrel; CmcsEquInfSampleBarrel cmcsEquInfSampleBarrelNew = CommonDAO.GetInstance().GetDber().Get <CmcsEquInfSampleBarrel>(cmcsEquInfSampleBarrel.Id); if (cmcsEquInfSampleBarrelNew != null) { if (String.IsNullOrEmpty(cmcsEquInfSampleBarrelNew.SampleCode)) { return(false); } } else { return(false); } } } return(true); }