public frmLeaveItem(tblLeave leave) : this() { Debug.Assert(leave != null); this._tblLeave = leave ; this.SelectedGroupID = leave.tblPerson.tblGroup.GroupID; this.SelectedPersonID = leave.tblPerson.PersonID; this.SelectedLeaveEnum = (LeaveEnum)leave.LeaveType; this.dtpBegin.Value = leave.LeaveBegin; this.dtpEnd.Value = leave.LeaveEnd; this.txtRemark.Text = leave.LeaveRemark; this._isAdd = false; }
private void detach_tblLeave(tblLeave entity) { this.SendPropertyChanging(); entity.tblPerson = null; }
private void attach_tblLeave(tblLeave entity) { this.SendPropertyChanging(); entity.tblPerson = this; }
partial void DeletetblLeave(tblLeave instance);
partial void UpdatetblLeave(tblLeave instance);
partial void InserttblLeave(tblLeave instance);
private void Add() { DB db = DBFactory.GetDB(); tblLeave l = new tblLeave(); l.tblPerson = db.tblPerson.Single(c => c.PersonID == SelectedPersonID); l.LeaveType = (int)SelectedLeaveEnum; l.LeaveBegin = this.dtpBegin.Value; l.LeaveEnd = this.dtpEnd.Value; l.LeaveRemark = this.txtRemark.Text.Trim(); db.tblLeave.InsertOnSubmit(l); db.SubmitChanges(); }