// // GET: /Timesheet/Create public ActionResult Create() { tblTimeSheet oEnt = new tblTimeSheet(); long EmployeeID = (long)Membership.GetUser().ProviderUserKey; oEnt.fldTimeSheetID = 0; oEnt.fldEmployeeID = EmployeeID; return View("Create", oEnt); }
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 void Update(tblTimeSheet model) { Execute(SqlUpdateCommand, model); }
public void Insert(tblTimeSheet model) { Execute(SqlInsertCommand, model); }