Ejemplo n.º 1
0
 private bool IsMatrixCellsNotEmpty(SAPbouiCOM.Matrix mtxControl, params string[] fields)
 {
     List<string> ValuesList = new List<string>();
     for (int i = 1; i <= mtxControl.RowCount; i++)
     {
         foreach (var v in fields)
         {
             ValuesList.Add(mtxControl.GetCellValue(v, i).ToString());
         }
     }
     var emptyValues = ValuesList.Where(x => x.Equals(string.Empty) || x.Equals("0.0")).ToList();
     if (emptyValues.Count == 0)
         return true;
     else
         return false;
     //bool isValid = true;
     //for (int i = 1; i <= mtxItems.RowCount; i++)
     //{
     //    if (mtxItems.GetCellValue("to_Item", i) == string.Empty || mtxItems.GetCellValue("rec_Item", i) == string.Empty || mtxItems.GetCellValue("FromWhs", i) == string.Empty
     //        || mtxItems.GetCellValue("ToWhs", i) == string.Empty || mtxItems.GetCellValue("Quantity", i) == string.Empty || mtxItems.GetCellValue("AvgPrice", i) == string.Empty || mtxItems.GetCellValue("AddAmount", i) == string.Empty || mtxItems.GetCellValue("AddAmount", i) == "0.0")
     //    {
     //        isValid = false;
     //        break;
     //    }
     //}
     //return isValid;
 }