Exemple #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (this.cmbStation.SelectedIndex < 0)
            {
                return;
            }
            if (this.cmbPerson.SelectedIndex < 0)
            {
                return;
            }

            string text = string.Format("添加 {0}, {1}, {2} ?", cmbPerson.Text, cmbStation.Text, this.dtpInsertDT.Value);
            if (MessageBox.Show(text, "cap", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            DB db = DBFactory.GetDB();

            tblTmData tmdata = new tblTmData();
            tmdata.tblDevice = db.tblDevice.Single(c => c.DeviceID == GetSelectedDeviceID());
            int tmid = GetSelectedTmID(db);
            tmdata.tblTM = db.tblTM.Single(c => c.TmID == tmid);
            tmdata.TmDataDT = this.dtpInsertDT.Value;

            db.tblTmData.InsertOnSubmit(tmdata);
            db.SubmitChanges();

            MessageBox.Show("添加成功");
        }
Exemple #2
0
 partial void DeletetblTmData(tblTmData instance);
Exemple #3
0
 partial void UpdatetblTmData(tblTmData instance);
Exemple #4
0
 partial void InserttblTmData(tblTmData instance);
Exemple #5
0
		private void detach_tblTmData(tblTmData entity)
		{
			this.SendPropertyChanging();
			entity.tblTM = null;
		}
Exemple #6
0
		private void attach_tblTmData(tblTmData entity)
		{
			this.SendPropertyChanging();
			entity.tblTM = this;
		}