예제 #1
0
        public ActionResult ViewAllAccount()
        {
            CreateCustomerAccounts2porDbData obj   = new CreateCustomerAccounts2porDbData();
            List <AccountSearch>             clist = obj.viewALLAccount();

            return(View(clist));
        }
예제 #2
0
        public void DownloadExcelAllAccount()
        {
            CreateCustomerAccounts2porDbData obj   = new CreateCustomerAccounts2porDbData();
            List <AccountSearch>             clist = obj.viewALLAccount();

            WebGrid grid = new WebGrid(source: clist);

            string gridData = grid.GetHtml(columns: grid.Columns(
                                               grid.Column("AccountID", "Account ID"),
                                               grid.Column("Customer_Id", "Customer ID"),
                                               grid.Column("AccountType", "Account Type"),
                                               grid.Column("account_status", "Status"),
                                               grid.Column("account_message", "Message"),
                                               grid.Column("update_date", "Last Updated(mm-dd-yyyy)")
                                               )).ToString();

            Response.ClearContent();
            Response.AddHeader("content-disposition", "attachment;filename=accountexcel.xls");
            Response.ContentType = "application/excel";
            Response.Write(gridData);
            Response.End();
        }