public ActionResult LeadsClosed(LeadClosedReportFilter model) { model.LeadStatusId = 3; //Lead Closed model.ShowReport = true; model.Result = LeadReportCore.LeadClosedReport(model); return(View(model)); }
public ActionResult LeadsClosed() { DateTime dCalcDate = DateTime.Now; LeadClosedReportFilter model = new LeadClosedReportFilter() { ShowReport = false, DateFrom = new DateTime(dCalcDate.Year, dCalcDate.Month, 1), DateTo = new DateTime(dCalcDate.Year, dCalcDate.Month, DateTime.DaysInMonth(dCalcDate.Year, dCalcDate.Month)) }; return(View(model)); }
public static List <LeadClosedReport> LeadClosedReport(LeadClosedReportFilter filter) { using (JazMax.DataAccess.JazMaxDBProdContext db = new DataAccess.JazMaxDBProdContext()) { var sqlParams = new SqlParameter[] { new SqlParameter { ParameterName = "@LeadStatusId", Value = filter.LeadStatusId }, new SqlParameter { ParameterName = "@CoreBranchId", Value = filter.BranchId }, new SqlParameter { ParameterName = "@DateFrom", Value = filter.DateFrom }, new SqlParameter { ParameterName = "@DateTo", Value = filter.DateTo }, }; return(db.Database.SqlQuery <LeadClosedReport>($"SPLeadClosedReport @LeadStatusId, @CoreBranchId, @DateFrom, @DateTo", sqlParams).ToList()); } }