public string GetNewEmployeeNumber(int BranchID, string DocumentId, string UserName) { HRDataContext entities = new HRDataContext(); return(entities.Database.SqlQuery <string>("Exec [Utility].[usp_GenerateDocumentNumber] @BranchID, @DocumentId, @TrxDate, @UserId", new SqlParameter("BranchID", BranchID), new SqlParameter("DocumentId", DocumentId), new SqlParameter("TrxDate", DateTime.Now.Date), new SqlParameter("UserId", UserName)).FirstOrDefault <string>()); }
public Repository(HRDataContext context) { this.hrDbContext = context; }