Example #1
0
 // Use this for initialization
 void Start()
 {
     buttonsDatabase = buttonsDatabase.GetComponent<ButtonsDatabase>();
     buttonsHandler = GetComponent<ButtonsHandler>();
     endGameText = endGameText.GetComponent<Text>();
     buttonAgain = buttonAgain.GetComponent<Button>();
     imageAtEnd = imageAtEnd.GetComponent<Image>();
     buttonBackToMenu = buttonBackToMenu.GetComponent<Button>();
     scoreScript = scoreScript.GetComponent<ScoreScript>();
     buttonResetScore = buttonResetScore.GetComponent<Button>();
     textResetScore = buttonResetScore.GetComponentInChildren<Text>();
     textBackToMenu = buttonBackToMenu.GetComponentInChildren<Text>();
     textPlayAgain = buttonAgain.GetComponentInChildren<Text>();
     isRunning = true;
 }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ButtonsModel model = null;
     this.ListPageLoad(this.Page, out model, base.Request["code"]);
     this.Buttons1_1.BM = model;
     ButtonsHandler handler = new ButtonsHandler(this.Buttons);
     handler(this.ibtid.Value);
     this.ibtid.Value = "";
     if (!this.Page.IsPostBack)
     {
         DataSet set = new PD_PROJECT_INSPECTION_Bll().HeDuiData(base.Request["code"]);
         if ((set != null) && (set.Tables[0].Columns.Count > 0))
         {
             this.gvResult.DataKeyNames = new string[] { set.Tables[0].Columns[0].ColumnName };
             for (int i = 0; i < set.Tables[0].Columns.Count; i++)
             {
                 BoundField field = new BoundField
                 {
                     DataField = set.Tables[0].Columns[i].ColumnName,
                     HeaderText = set.Tables[0].Columns[i].ColumnName,
                     SortExpression = set.Tables[0].Columns[i].ColumnName
                 };
                 field.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                 this.gvResult.Columns.Add(field);
             }
             this.gvResult.DataSource = set;
             if (set.Tables[0].Rows.Count == 0)
             {
                 set.Tables[0].Columns[0].DataType = typeof(string);
                 set.Tables[0].Rows.Add(set.Tables[0].NewRow());
                 set.Tables[0].Rows[0][0] = "无数据";
                 this.gvResult.DataSource = set;
                 this.gvResult.DataBind();
                 this.gvResult.Rows[0].Cells[0].ColumnSpan = set.Tables[0].Columns.Count;
                 int num2 = 1;
                 while (num2 < this.gvResult.Rows[0].Cells.Count)
                 {
                     this.gvResult.Rows[0].Cells.Remove(this.gvResult.Rows[0].Cells[num2]);
                 }
             }
             else
             {
                 set.Tables[0].DefaultView.RowFilter = "是否完全符合<>'是'";
                 DataView defaultView = set.Tables[0].DefaultView;
                 string str = "";
                 for (int j = 0; j < defaultView.Count; j++)
                 {
                     for (int k = 0; k < set.Tables[0].Columns.Count; k++)
                     {
                         object obj2 = str;
                         str = string.Concat(new object[] { obj2, "【", set.Tables[0].Columns[k].ColumnName, ":", defaultView[j][set.Tables[0].Columns[k].ToString()], "】" });
                         if (k < (set.Tables[0].Columns.Count - 1))
                         {
                             str = str + "、";
                         }
                     }
                     if (j < (defaultView.Count - 1))
                     {
                         str = str + "\r\n";
                     }
                 }
                 this.jgjlText_H.Value = str;
                 this.gvResult.DataBind();
             }
         }
     }
 }