public ActionResult Create(tblTimeSheet oEnt) { try { tblTimeSheetDap oDAC = new tblTimeSheetDap(); tblTimeSheet oEntComp = oDAC.GetByDayandEmployee(oEnt.fldEmployeeID, oEnt.fldDay); if (oEntComp == null) { oDAC.Insert(oEnt); return RedirectToAction("Index"); } else { return RedirectToAction("Edit", "Timesheet", new { id = oEntComp.fldTimeSheetID }); } } catch { return View(); } }
public tblTimeSheet GettblTimeSheetByfldTimeSheetID(Int64 fldTimeSheetID) { using (var dap = new tblTimeSheetDap(this)) { return dap.GetByfldTimeSheetID(fldTimeSheetID); } }
public List<tblTimeSheet> GettblTimeSheetByfldEmployeeID(Int64 fldEmployeeID) { using (var dap = new tblTimeSheetDap(this)) { return dap.GetByfldEmployeeID(fldEmployeeID); } }
public ActionResult Index() { long EmployeeID = (long)Membership.GetUser().ProviderUserKey; List<tblTimeSheet> listofEnt = new List<tblTimeSheet>(); tblTimeSheetDap newDap = new tblTimeSheetDap(); listofEnt = newDap.GetByfldEmployeeID(EmployeeID); return View(listofEnt); }