public ActionResult Upload() { string path = null; //HttpFileCollectionBase file; Import import = new Import(); try { //path = XMLHelpers.SaveFile(Request.Files, Server.MapPath("~/temp/")); var file = Request.Files[0]; var parser = new Parser.BaseParser.Parser(file.InputStream); using (var svc = new ParsingServiceClient()) { var data = parser.GetData(); import = svc.SaveData(data, 1); //todo: tahat aktualneho pouzivatela } } catch (Exception ex) { return View("Error", ex); } finally { if (path != null) System.IO.File.Delete(path); } Session["import"] = import; var bankImportedPayments = new BankAccountImportedPayments { Transactions = import.Account.Payments.ToPagedList(1, PAGE_SIZE), Pager = new Pager { CurrentPageIndex = 1, PageSize = PAGE_SIZE }, Account = new data.BankAccount { AccountID = import.Account.AccountID, Bank = new data.Bank { BankID = import.Account.Bank.BankID }, IBan = import.Account.IBan }, From = import.From, To = import.To }; bankImportedPayments.Pager.ItemsCount = bankImportedPayments.Transactions.Count; //bankImportedPayments.TransactionImport.Transactions = // bankImportedPayments.TransactionImport.Transactions.ToPagedList(page,PAGE_SIZE); return View("UploadDocument", bankImportedPayments); }
public FormMain() { InitializeComponent(); _client = new ParsingServiceClient("BasicHttpBinding_IParsingService"); }