コード例 #1
0
        private void btnEdit_Click()
        {
            try {
                string[] str = new string[dataGridView1.Rows.Count];
                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    if (dataGridView1.Rows[i].Selected == true)
                    {
                        Game_Setting game_SettingObject = new Game_Setting();
                        game_SettingObject.Id          = Convert.ToInt64(dataGridView1.Rows[i].Cells[0].Value);
                        game_SettingObject.Url         = Convert.ToString(dataGridView1.Rows[i].Cells[1].Value);
                        game_SettingObject.UserName    = Convert.ToString(dataGridView1.Rows[i].Cells[2].Value);
                        game_SettingObject.PassWord    = Convert.ToString(dataGridView1.Rows[i].Cells[3].Value);
                        game_SettingObject.ReMark      = Convert.ToString(dataGridView1.Rows[i].Cells[4].Value);
                        game_SettingObject.CreateDate  = Convert.ToDateTime(dataGridView1.Rows[i].Cells[5].Value);
                        game_SettingObject.DeadLine    = Convert.ToDateTime(dataGridView1.Rows[i].Cells[6].Value);
                        game_SettingObject.TryType     = (TryTypeEnum)Enum.Parse(typeof(TryTypeEnum), dataGridView1.Rows[i].Cells[7].Value.ToString(), false);
                        game_SettingObject.Devices     = (DevicesEnum)Enum.Parse(typeof(DevicesEnum), dataGridView1.Rows[i].Cells[8].Value.ToString(), false);
                        game_SettingObject.IsCompleted = Convert.ToBoolean(dataGridView1.Rows[i].Cells[9].Value);


                        frmGameSetting f1 = new frmGameSetting(game_SettingObject); //实例化窗体
                        this.Visible = false;                                       //设置当前窗体为不可视
                        f1.ShowDialog();                                            //打开窗体f1
                        this.Visible = true;
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("系统发生异常,请联系管理员!", "错误");
                LogHelper.WriteLog("窗体异常", ex);
            }
        }
コード例 #2
0
        private void btnAdd_Click()
        {
            frmGameSetting f1 = new frmGameSetting(); //实例化窗体

            this.Visible = false;                     //设置当前窗体为不可视

            f1.ShowDialog();                          //打开窗体f1
            this.Visible = true;
        }