private void Finalize(WorkerRoleStorage storage) { long size; string zip = this._WorkerRoleIO.CreateZIP(this.ZipName, this.ZipPassword); string uploadName = String.Format("{0}/{1}", this.UserID, Path.GetFileName(zip)); this.URL = storage.UploadFile(zip, uploadName, out size); this.Size = size; this._WorkerRoleIO.DeleteZIP(zip); }
private void Execute(string pathFile) { using (WorkerRoleStorage storage = new WorkerRoleStorage()) { using (DataSet ds = WorkerRoleSQL.Instance.GetDataReport(this.DownloadID)) { WorkerRoleExcel excel = new WorkerRoleExcel(pathFile); excel.AddResumeRow(ds.Tables["Resumen"].Rows[0]); foreach (DataRow row in ds.Tables["Detalle"].Rows) { excel.AddRow(row); storage.DownloadFile(this._WorkerRoleIO.CurrentDirectory, row.Field<string>("RIMImagenURL")); } excel.Save(); this.URLExcel = storage.UploadFileExcel(excel._Path, String.Format("download/{0}.xlsx", this.DownloadID)); this.ZipPassword = ds.Tables["ClienteClaveZIP"].Rows[0].Field<string>(0); } this.Finalize(storage); } }