示例#1
0
文件: frmMain.cs 项目: hkiaipc/fnq
        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("添加成功");
        }
示例#2
0
 partial void DeletetblTmData(tblTmData instance);
示例#3
0
 partial void UpdatetblTmData(tblTmData instance);
示例#4
0
 partial void InserttblTmData(tblTmData instance);
示例#5
0
		private void detach_tblTmData(tblTmData entity)
		{
			this.SendPropertyChanging();
			entity.tblTM = null;
		}
示例#6
0
		private void attach_tblTmData(tblTmData entity)
		{
			this.SendPropertyChanging();
			entity.tblTM = this;
		}