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