private void ExportToExcel() { DataTable Final = new DataTable(); int total = 0; Final = objBLL.SearchProductGroup(objSea, 1, out total); double RecordPerPage = 20; double tem = (total / RecordPerPage); totalPage = Math.Ceiling(tem); for (int i = 2; i <= totalPage; i++) // duyet tat ca cac trang { DataTable dt = objBLL.SearchProductGroup(objSea, i, out total); int j = Final.Rows.Count; foreach (DataRow dr in dt.Rows) { Final.Rows.Add(); int k = 0; for (k = 0; k < dt.Columns.Count; k++) { Final.Rows[j][k] = dr[k]; } j++; } } ExportExcelAlgorithms epex = new ExportExcelAlgorithms(); epex.ExportFileFromDataTable_Dung(Final, "CommonCode_" + DateTime.Now.ToString("ddMMyy_HHmmss"), "List of " + "CommonCode_" + DateTime.Now.ToString("ddMMyy_HHmmss"), null); }
//private void btnExcel_Click(object sender, EventArgs e) //{ // XuatExcel(); //} private void XuatExcel() { DataTable Final = new DataTable(); int total = 0; Final = proPriceBLL.SearchProductPrice(proPriceSea, 1, out total); double RecordPerPage = 20; double tem = (total / RecordPerPage); totalPage = Math.Ceiling(tem); for (int i = 2; i <= totalPage; i++) // duyet tat ca cac trang { DataTable dt = proPriceBLL.SearchProductPrice(proPriceSea, i, out total); int j = Final.Rows.Count; foreach (DataRow dr in dt.Rows) { Final.Rows.Add(); for (int k = 0; k < dt.Columns.Count; k++) { Final.Rows[j][k] = dr[k]; } j++; } } string[] prm = { "3" }; ExportExcelAlgorithms epex = new ExportExcelAlgorithms(); epex.ExportFileFromDataTable_Dung(Final, "Product Price_" + DateTime.Now.ToString("ddMMyy_HHmmss"), "List of " + "Product Price_" + DateTime.Now.ToString("ddMMyy_HHmmss"), prm); }
private void CreateObject() { memberBLL = new MemberBLL(); memberTypeBLL = new MemberTypeBLL(); countryBLL = new CountryBLL(); employeeBLL = new EmployeeBLL(); exportExcelAlgorithms = new ExportExcelAlgorithms(); // receiptBLL = new ReceiptBLL(); }
private void btnDownload_Click(object sender, EventArgs e) { try { exportExcelAlgorithms = new ExportExcelAlgorithms(); exportExcelAlgorithms.ExportFileFromDataGridViewEmployee(dgv, "EmployeeList"); } catch (Exception) { string code = System.Runtime.InteropServices.Marshal.GetExceptionCode().ToString(); if (code == "-532462766") { CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("CRM292"), Common.clsLanguages.GetResource("CRM11"), Common.Config.CUSTOM_MESSAGEBOX_ICON.Information, Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK); } return; } }
private void XuatExcel() { DataTable Final = new DataTable(); int total = 0; Final = supBLL.SearchIngredient(supSea, 1, out total); double RecordPerPage = 20; double tem = (total / RecordPerPage); totalPage = Math.Ceiling(tem); for (int i = 2; i <= totalPage; i++) // duyet tat ca cac trang { DataTable dt = supBLL.SearchIngredient(supSea, i, out total); int j = Final.Rows.Count; foreach (DataRow dr in dt.Rows) { Final.Rows.Add(); for (int k = 0; k < dt.Columns.Count; k++) { Final.Rows[j][k] = dr[k]; } j++; } } //ExportExcelAlgorithms epex = new ExportExcelAlgorithms(); //epex.ExportFileFromDataTable(Final, "Products_" + supBLL.GetDMY() + "_" + supBLL.GetHMS()); string[] prm = { "3" }; ExportExcelAlgorithms epex = new ExportExcelAlgorithms(); epex.ExportFileFromDataTable_Dung(Final, "Ingreadient_" + DateTime.Now.ToString("ddMMyy_HHmmss"), "List of " + "Suppliers_" + DateTime.Now.ToString("ddMMyy_HHmmss"), prm); }