Пример #1
0
        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;
        }
Пример #2
0
		private void detach_tblLeave(tblLeave entity)
		{
			this.SendPropertyChanging();
			entity.tblPerson = null;
		}
Пример #3
0
		private void attach_tblLeave(tblLeave entity)
		{
			this.SendPropertyChanging();
			entity.tblPerson = this;
		}
Пример #4
0
 partial void DeletetblLeave(tblLeave instance);
Пример #5
0
 partial void UpdatetblLeave(tblLeave instance);
Пример #6
0
 partial void InserttblLeave(tblLeave instance);
Пример #7
0
        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();
        }