Example #1
0
        public string GetCustomerExcelReport(int pageNumber, string searchTerm, int numberOfRecords, int rating = 0)
        {
            CustomerBusinessActions obj = new CustomerBusinessActions();
            var result    = obj.GetCustomerExcel(pageNumber, searchTerm, numberOfRecords, rating);
            var directory = HttpContext.Current.Server.MapPath("~/");
            var filename  = Path.Combine(directory, "Download", "Customer.xlsx");

            File.WriteAllBytes(filename, result);
            return(new JavaScriptSerializer().Serialize(filename));
        }
 public string GetCustomerExcelReport(int pageNumber, string searchTerm, int numberOfRecords, int rating = 0)
 {
     try
     {
         CustomerBusinessActions obj = new CustomerBusinessActions();
         var result    = obj.GetCustomerExcel(pageNumber, searchTerm, numberOfRecords, rating);
         var directory = HttpContext.Current.Server.MapPath("~/");
         var filename  = Path.Combine(directory, "Download", "Student.xlsx");
         File.WriteAllBytes(filename, result);
         return(new JavaScriptSerializer().Serialize(filename));
     }
     catch (Exception ex)
     {
         throw new SoapException(ex.Message, SoapException.ServerFaultCode, Context.Request.Url.AbsoluteUri);
     }
 }