public coderzModel.Models.Employee.EmployeeModelList GetEmployeeListSalesCountry(DateTime beginningDate, DateTime endingDate) { htParams["@Beginning_Date"] = beginningDate; htParams["@Ending_Date"] = endingDate; coderzModel.Models.Employee.EmployeeModelList employeeModelList = new coderzModel.Models.Employee.EmployeeModelList(); try { DataSet ds = results.GetSPDataSet("[dbo].[Employee Sales by Country]", htParams); employeeModelList = base.MappingEmployeeSalesCountry(ds); } catch (Exception) { throw; } return(employeeModelList); }
//Employees public coderzModel.Models.Employee.EmployeeModelList MappingEmployeeSalesCountry(System.Data.DataSet ds) { coderzModel.Models.Employee.EmployeeModelList employeeModelResults = new coderzModel.Models.Employee.EmployeeModelList(); employeeModelResults.Employees = new List <coderzModel.Models.Employee.EmployeeModel>(); foreach (System.Data.DataRow currentRow in ds.Tables[0].Rows) { coderzModel.Models.Employee.EmployeeModel employee = new coderzModel.Models.Employee.EmployeeModel(); if (!string.IsNullOrEmpty(currentRow["Country"].ToString())) { employee.Country = currentRow["Country"].ToString(); } if (!string.IsNullOrEmpty(currentRow["LastName"].ToString())) { employee.LastName = currentRow["LastName"].ToString(); } if (!string.IsNullOrEmpty(currentRow["FirstName"].ToString())) { employee.FirstName = currentRow["FirstName"].ToString(); } if (!string.IsNullOrEmpty(currentRow["ShippedDate"].ToString())) { employee.ShippedDate = (DateTime)currentRow["ShippedDate"]; } if (!string.IsNullOrEmpty(currentRow["OrderID"].ToString())) { employee.OrderID = (Int32)currentRow["OrderID"]; } if (!string.IsNullOrEmpty(currentRow["SaleAmount"].ToString())) { employee.SaleAmount = (decimal)currentRow["SaleAmount"]; } employeeModelResults.EmployeeCount++; employeeModelResults.Employees.Add(employee); } return(employeeModelResults); }