Beispiel #1
0
 private void UpdateRegulationAccepted(int aRowIndex, SlabInfo aSlabInfo)
 {
     var row = dataGridView1.Rows[aRowIndex];
     if (CheckRegulationsAccepted(aSlabInfo)) {
         row.Cells["Accepted"].Value = "Соответствует";
         row.DefaultCellStyle.BackColor = Color.White;
     }
     else {
         row.Cells["Accepted"].Value = "Не соответствует";
         row.DefaultCellStyle.BackColor = Color.LightGray;
     }
 }
Beispiel #2
0
        private bool CheckRegulationsAccepted(SlabInfo aSlabInfo)
        {
            if (slabsList.Regulations != null && aSlabInfo != null && client != null) {
                var dimentionResults = client.GetDimentionResultsBySlabId(aSlabInfo.Id);
                if (dimentionResults != null) {
                    for (var i = 0; i < slabsList.Regulations.Length; ++i) {
                        var regulation = slabsList.Regulations[i];
                        if (regulation.StandartSizeId == aSlabInfo.StandartSizeId) {
                            for (var j = 0; j < dimentionResults.Length; ++j) {
                                var dimentionResult = dimentionResults[j];
                                if (dimentionResult.DimentionId == regulation.DimentionId) {
                                    if (dimentionResult.Value < regulation.MinValue ||
                                        dimentionResult.Value > regulation.MaxValue) {
                                        return false;
                                    }
                                } // if
                            } // for
                        }
                    } // for
                } // if
            } // if

            return true;
        }
Beispiel #3
0
        private void CheckStandartSizeUpdated(int aRowIndex, SlabInfo aSlabInfo)
        {
            if (aRowIndex < 0 || aSlabInfo == null) {
                return;
            }

            var row = dataGridView1.Rows[aRowIndex];
            var standartSizeText = GetStandartSizeById(aSlabInfo.StandartSizeId);
            if (!Equals(row.Cells["StandartSize"].Value, standartSizeText)) {
                row.Cells["StandartSize"].Value = standartSizeText;
                row.Cells["standartSizeId"].Value = aSlabInfo.StandartSizeId;
                UpdateRegulationAccepted(aRowIndex, aSlabInfo);
            }
        }