Example #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;
                    }
                }
            }
        }
Example #2
0
        private void toPostOpForm(int pos_row, int pos_column)
        {
            PostOPTableDataRow p = _dataRowsArray[pos_row - 1];

            p.fetchODOSInfo();

            string click_part = (pos_column == 1) ? "OD" : "OS";
            string OPuuid     = (pos_column == 1) ? p.ODpostOpUUID : p.OSpostOpUUID;



            PostOPForm f = new PostOPForm(OPuuid, theOperativeCase.caseuuid, click_part, p.startDateString, p.endDateString);

            f.finishAction = (PostOPForm.PostOPFinishedAction action, string postuuid) =>
            {
                if (action == PostOPForm.PostOPFinishedAction.IsRefresh)
                {
                    //f.Close();
                    return;
                }
                if (action == PostOPForm.PostOPFinishedAction.IsChildCase)
                {
                    //f.Hide();
                    string childCaseuuid = DBOperativeCase.caseuuidFromParentPostOPuuid(postuuid);
                    PreOperativeMainForm childPreOPForm = new PreOperativeMainForm(childCaseuuid, postuuid);
                    childPreOPForm.ShowDialog();
                    childPreOPForm.Dispose();
                }
                renewDataRowsArray();
            };

            PostOPForm.Temp = this;
            Update_TabPage("postOPForm", f, OPuuid, theOperativeCase.caseuuid, click_part, p.startDateString, p.endDateString);

            this.passtabControl += new PasstabControl(f.ReceivepasstabControl);
            this.passtabControl(tabControlOperation);
            //f.ShowDialog();
            //f.Dispose();
            //f = null;
        }