⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xgst.cs

📁 好的系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
            this.label8.ForeColor = System.Drawing.Color.MediumSlateBlue;
            this.label8.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.label8.Location = new System.Drawing.Point(24, 328);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(64, 23);
            this.label8.TabIndex = 12;
            this.label8.Text = "学院";
            // 
            // userXY
            // 
            this.userXY.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.userXY.Items.AddRange(new object[] {
            "计算机",
            "软件",
            "外国语",
            "自动化",
            "通信"});
            this.userXY.Location = new System.Drawing.Point(104, 320);
            this.userXY.Name = "userXY";
            this.userXY.Size = new System.Drawing.Size(100, 20);
            this.userXY.TabIndex = 5;
            // 
            // label9
            // 
            this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label9.ForeColor = System.Drawing.Color.MediumSlateBlue;
            this.label9.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.label9.Location = new System.Drawing.Point(24, 376);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(64, 23);
            this.label9.TabIndex = 14;
            this.label9.Text = "电话";
            // 
            // userDH
            // 
            this.userDH.Location = new System.Drawing.Point(104, 368);
            this.userDH.Name = "userDH";
            this.userDH.Size = new System.Drawing.Size(100, 21);
            this.userDH.TabIndex = 6;
            // 
            // label10
            // 
            this.label10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label10.ForeColor = System.Drawing.Color.MediumSlateBlue;
            this.label10.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.label10.Location = new System.Drawing.Point(24, 416);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(64, 23);
            this.label10.TabIndex = 16;
            this.label10.Text = "地址";
            // 
            // userDZ
            // 
            this.userDZ.Location = new System.Drawing.Point(104, 416);
            this.userDZ.Name = "userDZ";
            this.userDZ.Size = new System.Drawing.Size(100, 21);
            this.userDZ.TabIndex = 7;
            // 
            // label11
            // 
            this.label11.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label11.ForeColor = System.Drawing.Color.MediumSlateBlue;
            this.label11.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.label11.Location = new System.Drawing.Point(24, 272);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(64, 23);
            this.label11.TabIndex = 18;
            this.label11.Text = "生日";
            // 
            // userSR
            // 
            this.userSR.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.userSR.Location = new System.Drawing.Point(104, 272);
            this.userSR.Name = "userSR";
            this.userSR.Size = new System.Drawing.Size(100, 21);
            this.userSR.TabIndex = 4;
            // 
            // pictureBox2
            // 
            this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
            this.pictureBox2.Location = new System.Drawing.Point(0, 0);
            this.pictureBox2.Name = "pictureBox2";
            this.pictureBox2.Size = new System.Drawing.Size(352, 48);
            this.pictureBox2.TabIndex = 20;
            this.pictureBox2.TabStop = false;
            // 
            // button1
            // 
            this.button1.BackColor = System.Drawing.Color.DeepSkyBlue;
            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button1.Location = new System.Drawing.Point(48, 456);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 8;
            this.button1.Text = "确定";
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // button2
            // 
            this.button2.BackColor = System.Drawing.Color.DeepSkyBlue;
            this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button2.Location = new System.Drawing.Point(152, 456);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 9;
            this.button2.Text = "取消";
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // XGST
            // 
            this.AcceptButton = this.button1;
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
            this.BackColor = System.Drawing.Color.LemonChiffon;
            this.CancelButton = this.button2;
            this.ClientSize = new System.Drawing.Size(358, 483);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.pictureBox2);
            this.Controls.Add(this.userSR);
            this.Controls.Add(this.label11);
            this.Controls.Add(this.userDZ);
            this.Controls.Add(this.userDH);
            this.Controls.Add(this.userPWD);
            this.Controls.Add(this.userName);
            this.Controls.Add(this.userXH);
            this.Controls.Add(this.label10);
            this.Controls.Add(this.label9);
            this.Controls.Add(this.userXY);
            this.Controls.Add(this.label8);
            this.Controls.Add(this.userXB);
            this.Controls.Add(this.label7);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.pictureBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
            this.Name = "XGST";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "修改学生档案";
            this.Load += new System.EventHandler(this.XGST_Load);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion

		

		private void button2_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
		  string stuID=this.userXH.Text.Trim();
		  string stuPWD=this.userPWD.Text.Trim();
		  string stuName=this.userName.Text.Trim();
		  string stuSex=this.userXB.SelectedItem.ToString();
	      string stuClass=this.userXY.SelectedItem.ToString();
		  string stuTEL=this.userDH.Text.Trim();
		  string stuAddress=this.userDZ.Text.Trim();
		  System.DateTime  dt1=this.userSR.Value;
			System.DateTime dt=dt1.Date;
		   if(stuPWD=="")
			{
				MessageBox.Show("密码不能为空");
			}
			else if(stuName=="")
			{
				MessageBox.Show("姓名不能为空");
			}
			else
			{
				DataAccess ds=new DataAccess();
				string sql="update  student set name='"+stuName+"', password='"+stuPWD+"',sex='"+stuSex+"',class='"+stuClass+"',tel='"+stuTEL+"',address='"+stuAddress+"',btime='"+dt+"' where stuid='"+stuID+"'";
				if(ds.ExecuteSQL(sql))
				{
					MessageBox.Show("修改成功");
					this.Close();
			   
				}
				else
				{
					MessageBox.Show("修改失败");
				}
			}
			}

		private void XGST_Load(object sender, System.EventArgs e)
		{
			DataAccess data=new DataAccess();
			string sql="select * from student where stuid='"+this.ID+"'";
			System.Data.DataSet  ds=data.GetDataSet(sql,"student");
			this.userXH.DataBindings.Add(new Binding("text",ds,"student.stuid"));
			this.userName.DataBindings.Add(new Binding("text",ds,"student.name"));
			this.userPWD.DataBindings.Add(new Binding("text",ds,"student.password"));
			this.userXB.DataBindings.Add(new Binding("text",ds,"student.sex"));
			this.userXY.DataBindings.Add(new Binding("text",ds,"student.class"));
			this.userDH.DataBindings.Add(new Binding("text",ds,"student.tel"));
			this.userDZ.DataBindings.Add(new Binding("text",ds,"student.address"));
			try
			{
				this.userSR.DataBindings.Add(new Binding("value",ds,"student.btime"));
			}
			catch
			{

			}
			
		}

        private void label6_Click(object sender, EventArgs e)
        {

        }
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -