Ejemplo n.º 1
0
        public static byte[] Download()
        {
            var employees       = new List <Employee>(DapperORM.ReturnList <Employee>("EmployeeViewAll"));
            var fileContentText = new StringBuilder();

            fileContentText.Append("EMPLOYEE NAME");
            fileContentText.Append("\t\t\t");
            fileContentText.Append("ADDRESS");
            fileContentText.Append("\t\t\t");
            fileContentText.Append("PHONE NUMBER");
            fileContentText.Append("\t\t");
            fileContentText.Append("DIVISION NAME");
            fileContentText.Append("\r\n");
            foreach (var employee in employees)
            {
                fileContentText.Append(employee.Name);
                fileContentText.Append("\t\t");
                fileContentText.Append(employee.Address);
                fileContentText.Append("\t\t");
                fileContentText.Append(employee.PhoneNumber);
                fileContentText.Append("\t\t");
                fileContentText.Append(employee.DivisionName);
                fileContentText.Append("\r\n");
            }
            var fileContent = Encoding.ASCII.GetBytes(fileContentText.ToString());

            return(fileContent);
        }
Ejemplo n.º 2
0
        public static IEnumerable <Employee> List()
        {
            var List = DapperORM.ReturnList <Employee>("EmployeeViewAll");

            return(List);
        }