Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int       state = 0;
            DataTable t     = config.querySql("EXEC getnewid", ref state);

            if (state == 1)
            {
                string cID   = t.Rows[0][0].ToString();
                int    index = ds.Rows.Count;
                ds.Rows.Add();//把新生成的用户ID添加到datagridview中
                dataGridView1.Rows[index].Cells["rid"].Value     = cID;
                dataGridView1.Rows[index].Cells["name"].Value    = "暂未设置";
                dataGridView1.Rows[index].Cells["consult"].Value = config.username;
                config.excuteSql("update main set consult = '" + config.username + "' where rid = '" + cID + "'");
                minor f3 = new minor(cID);//打开用户信息页面
                f3.Show();
            }
        }
Ejemplo n.º 2
0
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.ColumnIndex == 1 || e.ColumnIndex == 0)
         {
             string cID = dataGridView1.Rows[e.RowIndex].Cells["rid"].Value.ToString();
             minor  f   = new minor(cID);
             f.Show();
         }
     }
     catch (ArgumentOutOfRangeException)
     {
     }
     catch (Exception)
     {
         MessageBox.Show("要访问的用户信息不存在!", "提示");
     }
 }
 public fwf(string s, minor f)
 {
     InitializeComponent();
     sid = s;
     m   = f;
 }