public List <LEFSInterestCodeList> GetLEFSInterestCodeList(LEFSInterestCodeParam Param) { using (var db = new MainDbContext()) { return(db.Database.SqlQuery <LEFSInterestCodeList>( "exec GetLEFSInterestCodeList @Status,@InterestCode,@InterestType,@ContractType", new SqlParameter("@Status", string.IsNullOrWhiteSpace(Param.Status) ? "" : Param.Status), new SqlParameter("@InterestCode", string.IsNullOrWhiteSpace(Param.InterestCode) ? "" : Param.InterestCode), new SqlParameter("@InterestType", string.IsNullOrWhiteSpace(Param.InterestType) ? "" : Param.InterestType), new SqlParameter("@ContractType", string.IsNullOrWhiteSpace(Param.ContractType) ? "" : Param.ContractType) ).ToList()); } }
public PartialViewResult LEFSInterestCodeListView(LEFSInterestCodeParam Param, string ViewType) { var db = new MainDbContext(); var interestCodeList = _clsLEFSInterestCode.GetLEFSInterestCodeList(Param); LEFSInterestCodeListViewModel vm = new LEFSInterestCodeListViewModel(); vm.Action = ViewType; vm.LEFSInterestCodeList.AddRange(interestCodeList); return(PartialView("_LEFSInterestCodeListView", vm)); }