public ActionResult Add(Byod byod) { try { //var account = _iFUser.ReadUser(Username); //byod.EmployeeId = account.EmployeeId; //byod.RequestedBy = account.EmployeeId; //var employee = _iFEmployee.Read(account.EmployeeId); //byod.ApproverId = employee.ManagerEmployeeId; byod = _iFByod.Create(byod); return(RedirectToAction("Index")); } catch (Exception ex) { return(Json(byod)); } }
public ActionResult Create(Byod byod) { try { var account = CurrentUser; byod.EmployeeId = account.EmployeeId; byod.RequestedBy = account.UserId; byod.CreatedBy = account.UserId; if (account.EmployeeId != 0) { var employee = _iFEmployee.Read(account.EmployeeId); byod.ApproverId = employee.ManagerEmployeeId; } byod = _iFByod.Create(byod); return(RedirectToAction("Index")); } catch (Exception ex) { return(Json(ex)); } }