public Admin(tbl_AdminDetail a) { ID = a.UserID; Salary = a.Salary; HireDate = a.HireDate.Value; Shift = a.Shift; }
public void loadAdminDetails() { LibraryDBDataContext db = new LibraryDBDataContext(); tbl_AdminDetail a = (from temp in db.tbl_AdminDetails where temp.UserID == this.ID select temp ).FirstOrDefault(); this.Salary = a.Salary; this.HireDate = a.HireDate.Value; this.Shift = a.Shift; }
public new void Add() { LibraryDBDataContext db = new LibraryDBDataContext(); base.Add(); tbl_AdminDetail a = new tbl_AdminDetail(); a.UserID = base.ID; a.Salary = this.Salary; a.HireDate = this.HireDate; a.Shift = this.Shift; db.tbl_AdminDetails.InsertOnSubmit(a); db.SubmitChanges(); }