Example #1
0
        private void add_Click(object sender, EventArgs e)
        {
            SuperMarketDataClassesDataContext db = new SuperMarketDataClassesDataContext();
            SIMS_user user = new SIMS_user();

            user.userName = userName.Text;
            user.userPwd  = passWord.Text;
            if (radioButton1.Checked)
            {
                user.userSex = "男";
            }
            else if (radioButton2.Checked)
            {
                user.userSex = "女";
            }
            user.userPhone = phone.Text;
            user.note      = remarks.Text;
            db.SIMS_user.InsertOnSubmit(user);
            try
            {
                db.SubmitChanges();
                MessageBox.Show("添加成功!");
                dataGridView1.DataSource = db.SIMS_user;
            }
            catch (Exception ex)
            {
            }
        }
Example #2
0
 partial void UpdateSIMS_user(SIMS_user instance);
Example #3
0
 partial void DeleteSIMS_user(SIMS_user instance);
Example #4
0
 partial void InsertSIMS_user(SIMS_user instance);