Exemplo n.º 1
0
        private void renewDataRowsArray()
        {
            if (_dataRowsArray == null)
            {
                _dataRowsArray = new List <PostOPTableDataRow>();
            }
            else
            {
                _dataRowsArray.Clear();
            }

            PostOPTableDataRow.fetchWithOriginalArray(_dataRowsArray, theOperativeCase.caseuuid, theOperativeCase.opdate,
                                                      (bool success, List <PostOPTableDataRow> resultArray) =>
            {
                foreach (PostOPTableDataRow p in resultArray)
                {
                }
            }
                                                      );

            for (int row_i = 1; row_i < this.tableLayoutPanel1.RowCount; row_i++)
            {
                Control lbTitle = this.tableLayoutPanel1.GetControlFromPosition(0, row_i);
                if (lbTitle != null)
                {
                    PostOPTableDataRow p = _dataRowsArray[row_i - 1];
                    lbTitle.Text = p.title;
                }

                Control odbtn = this.tableLayoutPanel1.GetControlFromPosition(1, row_i);
                if (odbtn != null)
                {
                    PostOPTableDataRow p = _dataRowsArray[row_i - 1];

                    odbtn.Text = p.ODpostDateString == "" ? "ADD +" : p.ODpostDateString;
                    if (p.ODpostDateString != "" && p.ODchildCaseUUID != "")
                    {
                        odbtn.BackColor = Color.Red;
                    }
                }

                Control osbtn = this.tableLayoutPanel1.GetControlFromPosition(2, row_i);
                if (osbtn != null)
                {
                    PostOPTableDataRow p = _dataRowsArray[row_i - 1];
                    osbtn.Text = p.OSpostDateString == "" ? "ADD +" : p.OSpostDateString;
                    if (p.OSpostDateString != "" && p.OSchildCaseUUID != "")
                    {
                        osbtn.BackColor = Color.Red;
                    }
                }
            }
        }