private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (i < 0) { return; } try { int sl = 0; for (int j = 0; j < hienthibaocao.Length; j++) { if (hienthibaocao[j].MaHangHoa == dtgvhienthi.Rows[i].Cells["MaHangHoa"].Value.ToString()) { sl++; } } Entities.BCDTTheoHangHoa[] a = new Entities.BCDTTheoHangHoa[sl]; sl = 0; for (int j = 0; j < hienthibaocao.Length; j++) { if (hienthibaocao[j].MaHangHoa == dtgvhienthi.Rows[i].Cells["MaHangHoa"].Value.ToString()) { a[sl] = hienthibaocao[j]; sl++; } } frmBaoCaorpt b = new frmBaoCaorpt(a, truoc, sau); b.ShowDialog(); } catch { } }
private void tsslExcel_Click(object sender, EventArgs e) { string makho = dtgvhienthi.CurrentRow.Cells["MaKho"].Value.ToString(); string tenkho = dtgvhienthi.CurrentRow.Cells["TenKho"].Value.ToString(); if ((int)dtgvhienthi.CurrentRow.Cells["TongSoLuongNhap"].Value == 0) { MessageBox.Show("Không có hàng nhập kho" + tenkho + " trong Khoảng từ ngày : " + xulyNgay(BatDau) + " đến " + xulyNgay(KetThuc) + " "); } else { saveFileDialog1.Filter = "Excel |*.xls"; saveFileDialog1.FileName = ""; if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LayHoaDonNhap_TheoMaKho(makho); LayKHTL_TheoMaKho(makho); LayPhieuDieuChuyenKhoNoiBo_TheoKhoDen(makho); LayChiTiet_HangHoaXuat_TheoKho(makho, tenkho); LayChiTiet_SoLuong_HangHoaNhap_TheoKho(); frmBaoCaorpt frm = new frmBaoCaorpt(ctBCXH, BatDau, KetThuc, saveFileDialog1.FileName, "Excel"); frm.ShowDialog(); } } }
private void tsslExcel_Click(object sender, EventArgs e) { try { List <Entities.SoQuy> tem0 = ((Entities.SoQuy[])dtgvhienthi.DataSource).ToList(); tem0.RemoveAt(tem0.Count - 1); Entities.SoQuy[] tem = tem0.ToArray(); if (tem.Length > 0) { SaveFileDialog s = new SaveFileDialog(); s.Filter = "XLS |*.xls"; if (s.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (Entities.SoQuy item in tem) { item.MaTK = lbhienthima.Text; item.TenTK = lbhienthiten.Text; item.DuDauKy = txtdudauky.Text; item.DuCuoiKy = txtducuoiky.Text; } frmBaoCaorpt a = new frmBaoCaorpt("SoQuy_XLS", tem, s.FileName, false); a.ShowDialog(); } } else { MessageBox.Show("Vui lòng kiểm tra lại dữ liệu trước khi in!"); } } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; try { ///////////////////////////////MRK FIX Hiển thị List <Entities.BCXuatHuyHangHoa> tem0 = ((Entities.BCXuatHuyHangHoa[])dtgvhienthi.DataSource).ToList(); //Entities.BCXuatHuyHangHoa dau = new Entities.BCXuatHuyHangHoa(); //dau = tem0[0]; Entities.BCXuatHuyHangHoa cuoi = new Entities.BCXuatHuyHangHoa(); cuoi = tem0[tem0.Count - 1]; //tem0.Remove(dau); tem0.Remove(cuoi); //////////////////////////////////////////////// hienthibaocao = tem0.ToArray(); //hienthibaocao = (Entities.BCXuatHuyHangHoa[])dtgvhienthi.DataSource; frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao, truoc, sau); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void btnXem_Click(object sender, EventArgs e) { try { // Khach hang if (kh1 != null) { string maKhachHang = kh1.MaKH; string tenKhachHang = kh1.Ten; string diaChi = kh1.DiaChi; double duDauKy = double.Parse(txtdudauky.Text); double duCuoiKy = double.Parse(txtducuoiky.Text); frmBaoCaorpt a = new frmBaoCaorpt(list.ToArray(), maKhachHang, tenKhachHang, diaChi, duDauKy, duCuoiKy, "In", "", "KH", "Khách Hàng"); a.ShowDialog(); } else { string maKhachHang = ncc1.MaNhaCungCap; string tenKhachHang = ncc1.TenNhaCungCap; string diaChi = ncc1.DiaChi; double duDauKy = double.Parse(txtdudauky.Text); double duCuoiKy = double.Parse(txtducuoiky.Text); frmBaoCaorpt a = new frmBaoCaorpt(list.ToArray(), maKhachHang, tenKhachHang, diaChi, duDauKy, duCuoiKy, "In", "", "NCC", "Nhà Cung Cấp"); a.ShowDialog(); } } catch (Exception) { } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { this.Enabled = false; try { Entities.BCTienTonKho[] data = (Entities.BCTienTonKho[])dtgvhienthi.DataSource; if (data == null) { return; } else if (data.Length == 0) { return; } if (chon < 0) { return; } string MK = dtgvhienthi["MaKho", chon].Value.ToString(); foreach (Entities.BCTienTonKho item in data) { if (item.MaKho.Equals(MK)) { //Xem frmBaoCaorpt a = new frmBaoCaorpt(item, start.ToString("dd/MM/yyyy"), end.ToString("dd/MM/yyyy")); a.ShowDialog(); } } } catch { } finally { this.Enabled = true; } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (i < 0) { return; } try { disable(); string manhomhang = dtgvhienthi["MaNhomHang", i].Value.ToString(); Report.rptXuatNhapHangTheoNhomHang report = new Report.rptXuatNhapHangTheoNhomHang(); report.SetDataSource(ChiTietNhom(manhomhang)); report.SetParameterValue("Ky", thang.ToString() + "-" + nam.ToString()); report.SetParameterValue("TenBaoCao", "Báo Cáo Xuất Nhập Tồn Theo Nhóm Hàng"); frmBaoCaorpt a = new frmBaoCaorpt(report); a.ShowDialog(); } catch { } finally { enable(); } }
private void tsslchitiet_Click(object sender, EventArgs e) { //CongTy(); //cl = new Server_Client.Client(); //this.client1 = cl.Connect(Luu.IP, Luu.Ports); //Entities.rptBCChiTietHangHoa kh = new Entities.rptBCChiTietHangHoa("Select"); //Entities.rptBCChiTietHangHoa[] kh1 = new Entities.rptBCChiTietHangHoa[1]; //clientstrem = cl.SerializeObj(this.client1, "BCChiTietHangHoa", kh); //kh1 = (Entities.rptBCChiTietHangHoa[])cl.DeserializeHepper1(clientstrem, kh1); //if (kh1 == null) //{ // MessageBox.Show("Không có dữ liệu", "Hệ thống cảnh báo"); // return; //} //GUI.Report.rptBCChiTietHangHoa report = new GUI.Report.rptBCChiTietHangHoa(); //report.SetDataSource(kh1); //crvReport.ReportSource = report; //report.SetParameterValue("TenCongTy", CT.TenCongTy); //report.SetParameterValue("DiaChiCongTy", CT.DiaChi); //report.SetParameterValue("DienThoai", CT.SoDienThoai); //report.SetParameterValue("FaxCongTy", CT.Fax); //report.SetParameterValue("Web", CT.Website); //report.SetParameterValue("TenBaoCao", "Báo Cáo Chi Tiết Hàng Hóa"); //report.SetParameterValue("NgayTao", new Common.Utilities().XuLy(2, DateServer.Date().ToShortDateString())); //report.SetParameterValue("MaNhanVien", Common.Utilities.User.TenNhanVien); //report.SetParameterValue("Email", CT.Email); //crvReport.Show(); //break; frmBaoCaorpt frm = new frmBaoCaorpt("ChiTietHangHoa"); frm.ShowDialog(); }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { this.Enabled = false; try { ///////////////////////////////MRK FIX Hiển thị List <Entities.BCThue> tem0 = ((Entities.BCThue[])dtgvhienthi.DataSource).ToList(); //Entities.BCThue dau = new Entities.BCThue(); //dau = tem0[0]; Entities.BCThue cuoi = new Entities.BCThue(); cuoi = tem0[tem0.Count - 1]; //tem0.Remove(dau); tem0.Remove(cuoi); //////////////////////////////////////////////// hienthibaocao = tem0.ToArray(); frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao, mathue, giatrithue, truoc, sau); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } string makho = dtgvhienthi.Rows[e.RowIndex].Cells["MaKho"].Value.ToString(); string tenkho = dtgvhienthi.Rows[e.RowIndex].Cells["TenKho"].Value.ToString(); if ((int)dtgvhienthi.Rows[e.RowIndex].Cells["TongSoLuongNhap"].Value == 0) { MessageBox.Show("Không có hàng nhập kho" + tenkho + " trong Khoảng từ ngày : " + xulyNgay(BatDau) + " đến " + xulyNgay(KetThuc) + " "); } else { LayHoaDonNhap_TheoMaKho(makho); LayKHTL_TheoMaKho(makho); LayPhieuDieuChuyenKhoNoiBo_TheoKhoDen(makho); LayChiTiet_HangHoaXuat_TheoKho(makho, tenkho); LayChiTiet_SoLuong_HangHoaNhap_TheoKho(); frmBaoCaorpt frm = new frmBaoCaorpt(ctBCXH, BatDau, KetThuc); frm.ShowDialog(); } }
private void tsslchitiet_Click(object sender, EventArgs e) { if (i < 0) return; try { int sl = 0; for (int j = 0; j < hienthibaocao.Length; j++) { string mahanghoa = dtgvhienthi.Rows[i].Cells["MaHangHoa"].Value.ToString(); if (hienthibaocao[j].MaHangHoa == dtgvhienthi.Rows[i].Cells["MaHangHoa"].Value.ToString()) { sl++; } } Entities.BCDTTheoHangHoa[] a = new Entities.BCDTTheoHangHoa[sl]; sl = 0; for (int j = 0; j < hienthibaocao.Length; j++) { if (hienthibaocao[j].MaHangHoa == dtgvhienthi.Rows[i].Cells["MaHangHoa"].Value.ToString()) { a[sl] = hienthibaocao[j]; sl++; } } frmBaoCaorpt b = new frmBaoCaorpt(hienthibaocao, truoc, sau); b.ShowDialog(); } catch { } }
private void tsslWord_Click(object sender, EventArgs e) { try { List <Entities.SoQuy> tem0 = ((Entities.SoQuy[])dtgvsoquy.DataSource).ToList(); tem0.RemoveAt(tem0.Count - 1); Entities.SoQuy[] tem = tem0.ToArray(); if (tem.Length > 0) { SaveFileDialog s = new SaveFileDialog(); s.Filter = "DOC |*.doc"; if (s.ShowDialog() == System.Windows.Forms.DialogResult.OK) { frmBaoCaorpt a = new frmBaoCaorpt("SoQuy_DOC", tem, s.FileName, true); a.ShowDialog(); } } else { MessageBox.Show("Vui lòng kiểm tra lại dữ liệu trước khi in!"); } } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { try { List <Entities.SoQuy> tem0 = ((Entities.SoQuy[])dtgvhienthi.DataSource).ToList(); tem0.RemoveAt(tem0.Count - 1); Entities.SoQuy[] tem = tem0.ToArray(); if (tem.Length > 0) { foreach (Entities.SoQuy item in tem) { item.MaTK = lbhienthima.Text; item.TenTK = lbhienthiten.Text; item.DuDauKy = txtdudauky.Text; item.DuCuoiKy = txtducuoiky.Text; } frmBaoCaorpt a = new frmBaoCaorpt("SoQuy_In", tem, "", false); a.ShowDialog(); } else { MessageBox.Show("Vui lòng kiểm tra lại dữ liệu trước khi in!"); } } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { if (i < 0) { return; } try { disable(); string maloaihang = dtgvhienthi["MaHangHoa", i].Value.ToString(); Report.rptBaoCaoNhapHangTheoMatHang report = new Report.rptBaoCaoNhapHangTheoMatHang(); report.SetDataSource(ChiTietHang(maloaihang)); report.SetParameterValue("Ky", thang.ToString() + "-" + nam.ToString()); report.SetParameterValue("TenBaoCao", "Báo Cáo Nhập Hàng Theo Hàng Hóa"); frmBaoCaorpt a = new frmBaoCaorpt(report); a.ShowDialog(); } catch { } finally { enable(); } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (i < 0) { return; } try { string b = ""; string c = "01/" + cbbthang.Text + "/" + cbbnam.Text; if (cbbthang.Text == "12") { b = "01/01/" + (int.Parse(cbbnam.Text) + 1).ToString(); } else { b = "01/" + (int.Parse(cbbthang.Text) + 1).ToString() + "/" + cbbnam.Text; } frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao.ToArray(), c, b, ""); a.ShowDialog(); } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; //if (i < 0) // return; try { Entities.BCNhapHangTheoNhom[] data = (Entities.BCNhapHangTheoNhom[])dtgvhienthi.DataSource; if (data == null) { return; } else if (data.Length == 0) { return; } //Xem string MaNhomHang = dtgvhienthi["MaNhomHang", i].Value.ToString(); List <Entities.BCNhapHangTheoNhomChiTiet> L = (from k in HIENTHIBAOCAO where k.MaNhomHang.Equals(MaNhomHang) select k).ToList(); frmBaoCaorpt a = new frmBaoCaorpt(L.ToArray(), thang.ToString(), nam.ToString()); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void btnXem_Click(object sender, EventArgs e) { try { frmBaoCaorpt a = new frmBaoCaorpt(ctkhArr, truoc, sau, "In", ""); a.ShowDialog(); } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { try { frmBaoCaorpt a = new frmBaoCaorpt(baocao, truoc, sau); a.ShowDialog(); } catch { } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (i < 0) { return; } frmBaoCaorpt a = new frmBaoCaorpt("Kho", dtgvhienthi["MaKho", i].Value.ToString()); a.ShowDialog(); } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { //frmBaoCaorpt frm = new frmBaoCaorpt(temp, BatDau, KetThuc); //frm.ShowDialog(); try { frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao, truoc, sau, "k29vn"); a.ShowDialog(); } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { if (dtgvhienthi.RowCount > 1) { try { frmBaoCaorpt a = new frmBaoCaorpt("NCC"); a.ShowDialog(); } catch { } } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dtgvhienthi.RowCount > 1) { try { frmBaoCaorpt a = new frmBaoCaorpt("NCC"); a.ShowDialog(); } catch { } } }
private void tsslchitiet_Click(object sender, EventArgs e) { if (i < 0) { return; } try { frmBaoCaorpt a = new frmBaoCaorpt("NhanVien", dtgvhienthi.Rows[i].Cells["MaNhanVien"].Value.ToString(), truoc, sau); a.ShowDialog(); } catch { } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (i < 0) { return; } try { if (dtgvhienthi.Rows[i].Cells["TenNhanVien"].Value.ToString().Equals("Tổng Cộng: ")) { return; } frmBaoCaorpt a = new frmBaoCaorpt("NhanVien", dtgvhienthi.Rows[i].Cells["MaNhanVien"].Value.ToString(), truoc, sau); a.ShowDialog(); } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; try { if (i < 0) { return; } frmBaoCaorpt a = new frmBaoCaorpt("Kho", dtgvhienthi["MaKho", i].Value.ToString()); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; if (i < 0) { return; } try { frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao, thang + "/" + nam); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { this.Enabled = false; if (i < 0) { return; } try { frmBaoCaorpt a = new frmBaoCaorpt(ChiTiet(), thang + "/" + nam); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; if (i < 0) { return; } try { frmBaoCaorpt b = new frmBaoCaorpt(hienthibaocao.ToArray(), truoc, sau); b.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { try { List <Entities.SoQuy> tem0 = ((Entities.SoQuy[])dtgvsoquy.DataSource).ToList(); tem0.RemoveAt(tem0.Count - 1); Entities.SoQuy[] tem = tem0.ToArray(); if (tem.Length > 0) { frmBaoCaorpt a = new frmBaoCaorpt("SoQuy_In", tem, "", true); a.ShowDialog(); } else { MessageBox.Show("Vui lòng kiểm tra lại dữ liệu trước khi in!"); } } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; if (i < 0) { return; } try { string maloaihang = dtgvhienthi["MaLoaiHang", i].Value.ToString(); frmBaoCaorpt a = new frmBaoCaorpt(ChiTietLoai(maloaihang), thang + "/" + nam); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; if (i < 0) return; try { string maloaihang = dtgvhienthi["MaLoaiHang", i].Value.ToString(); frmBaoCaorpt a = new frmBaoCaorpt(ChiTietLoai(maloaihang), thang + "/" + nam); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { frmBaoCaorpt frm = new frmBaoCaorpt(temp, BatDau, KetThuc); frm.ShowDialog(); }
private void toolStripStatusLabel3_Click(object sender, EventArgs e) { this.Enabled = false; try { string khachtra = string.IsNullOrEmpty(txtkhachtra.Text) ? "0" : txtkhachtra.Text; frmBaoCaorpt bcrpt = new frmBaoCaorpt("HDBanLe", txtSochungtu.Text, Double.Parse(txtGiamgia.Text), khachtra, txtdutra.Text, txtKhachPhaiTra.Text, txtGTGT.Text, lbnhanvien.Text, "kin", mskngaychungtu.Text, txtGTTheVip.Text, txtGTTheGT.Text, "", txtChietkhau.Text, "", "", ""); bcrpt.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { if (i < 0) return; try { disable(); string manhomhang = dtgvhienthi["MaNhomHang", i].Value.ToString(); Report.rptXuatNhapHangTheoNhomHang report = new Report.rptXuatNhapHangTheoNhomHang(); report.SetDataSource(ChiTietNhom(manhomhang)); report.SetParameterValue("Ky", thang.ToString() + "-" + nam.ToString()); report.SetParameterValue("TenBaoCao", "Báo Cáo Xuất Nhập Tồn Theo Nhóm Hàng"); frmBaoCaorpt a = new frmBaoCaorpt(report); a.ShowDialog(); } catch { } finally { enable(); } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (i < 0) return; try { if (dtgvhienthi.Rows[i].Cells["TenNhanVien"].Value.ToString().Equals("Tổng Cộng: ")) { return; } frmBaoCaorpt a = new frmBaoCaorpt("NhanVien", dtgvhienthi.Rows[i].Cells["MaNhanVien"].Value.ToString(), truoc, sau); a.ShowDialog(); } catch { } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { this.Enabled = false; if (i < 0) return; try { frmBaoCaorpt a = new frmBaoCaorpt(ChiTiet(), thang + "/" + nam); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { if (i < 0) return; try { frmBaoCaorpt a = new frmBaoCaorpt("NhanVien", dtgvhienthi.Rows[i].Cells["MaNhanVien"].Value.ToString(), truoc, sau); a.ShowDialog(); } catch { } }
private void toolStripStatusLabel3_Click(object sender, EventArgs e) { ArrayList arr = new ArrayList(); foreach (DataGridViewRow item in dgvInsertOrder.Rows) { Entities.BCKhachHangDatHang temp = new Entities.BCKhachHangDatHang(); temp.MaDonDatHang = txtSodonhang.Text; temp.MaKH = txtManhacungcap.Text; temp.Ten = lblTennhacungcap.Text; temp.MaHang = item.Cells[1].Value.ToString(); temp.TenHang = item.Cells[2].Value.ToString(); temp.SoLuong = Convert.ToDouble(item.Cells[3].Value.ToString()); temp.Gia = Convert.ToDouble(item.Cells[4].Value.ToString()); temp.ChietKhau = Convert.ToDouble(item.Cells[7].Value.ToString()); temp.Thue = Convert.ToDouble(item.Cells[8].Value.ToString()); temp.TongTienCK = Convert.ToDouble(item.Cells[9].Value.ToString()); temp.TongTien = Convert.ToDouble(item.Cells[11].Value.ToString()); arr.Add(temp); } if (arr.Count > 0) { Entities.BCKhachHangDatHang[] rpt = new Entities.BCKhachHangDatHang[arr.Count]; int i = 0; foreach (object item in arr) { rpt[i] = (Entities.BCKhachHangDatHang)item; i++; } if (check_loaidathang.Checked) { Report.rptDatHangNhaCungCap khdh = new Report.rptDatHangNhaCungCap(); khdh.SetDataSource(rpt); khdh.SetParameterValue("TongTien", txtTienhang.Text); khdh.SetParameterValue("TongTienCK", txtChietkhau.Text); khdh.SetParameterValue("TienThue", txtGiatrigiatang.Text); khdh.SetParameterValue("TongTienCK", txtChietkhau.Text); khdh.SetParameterValue("TongTienDonHang", txtTongtien.Text); khdh.SetParameterValue("NgayTao", makNgaydonhang.Text); khdh.SetParameterValue("TenBaoCao", "Báo Cáo Đặt Hàng Nhà Cung Cấp"); frmBaoCaorpt frm = new frmBaoCaorpt(khdh); frm.ShowDialog(); } else { Report.rptKhachHangDatHang khdh = new Report.rptKhachHangDatHang(); khdh.SetDataSource(rpt); khdh.SetParameterValue("TongTien", txtTienhang.Text); khdh.SetParameterValue("TongTienCK", txtChietkhau.Text); khdh.SetParameterValue("TienThue", txtGiatrigiatang.Text); khdh.SetParameterValue("TongTienCK", txtChietkhau.Text); khdh.SetParameterValue("TongTienDonHang", txtTongtien.Text); khdh.SetParameterValue("NgayTao", makNgaydonhang.Text); khdh.SetParameterValue("TenBaoCao", "Báo Cáo Khách Hàng Đặt Hàng"); frmBaoCaorpt frm = new frmBaoCaorpt(khdh); frm.ShowDialog(); } } }
private void tsslchitiet_Click(object sender, EventArgs e) { if (dtgvhienthi.RowCount > 1) { try { frmBaoCaorpt a = new frmBaoCaorpt("KhachHang"); a.ShowDialog(); } catch { } } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { this.Enabled = false; if (i < 0) return; try { string makho = dtgvhienthi["MaKho", i].Value.ToString(); frmBaoCaorpt a = new frmBaoCaorpt(ChiTietKho(makho), thang + "/" + nam); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; try { Entities.ChiTietTheGiamGia[] data = (Entities.ChiTietTheGiamGia[])dtgvhienthi.DataSource; if (data == null) { return; } else if (data.Length == 0) { return; } //Xem frmBaoCaorpt a = new frmBaoCaorpt( data, start.ToString("dd/MM/yyyy"), end.ToString("dd/MM/yyyy")); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; if (i < 0) return; try { frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao, thang + "/" + nam); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string maNhomHang = dtgvhienthi.Rows[e.RowIndex].Cells["MaNhomHang"].Value.ToString(); string tenNhomHang = dtgvhienthi.Rows[e.RowIndex].Cells["TenNhomHang"].Value.ToString(); if ((int)dtgvhienthi.Rows[e.RowIndex].Cells["TongSoLuongXuat"].Value == 0) { MessageBox.Show("Không có Hàng Xuất từ kho" + tenNhomHang + " trong Khoảng từ ngày : " +xulyNgay( BatDau) + " đến " +xulyNgay( KetThuc) + " "); } else { LayChiTiet_HangHoaXuat_TheoNhomHang(maNhomHang, tenNhomHang); LayChiTiet_SoLuong_HangHoaXuat_TheoKho(); //dtgvhienthi.DataSource=ctBCXH; //FixDatagridview(); frmBaoCaorpt frm = new frmBaoCaorpt(ctBCXH, BatDau,KetThuc); frm.ShowDialog(); ctBCXH = null; } }
private void btnXem_Click(object sender, EventArgs e) { try { Entities.TongHopCongNo[] congNo = congNoList.ToArray(); string thang = cbbthang.SelectedItem.ToString(); string nam = cbbnam.SelectedItem.ToString(); // Khach hang if (cbbdoituong.SelectedIndex == 0) { frmBaoCaorpt a = new frmBaoCaorpt(congNo, thang, nam, "In", "", "KH", "Khách Hàng"); a.ShowDialog(); } else { frmBaoCaorpt a = new frmBaoCaorpt(congNo, thang, nam, "In", "", "NCC", "Nhà Cung Cấp"); a.ShowDialog(); } } catch (Exception) { } }
/// <summary> /// Xuất báo cáo /// </summary> /// <param name="select">0: View, 1: PDF, 2: WORD, 3: EXCEL</param> void ExportBc(int select) { if (rdoTheoNgay.Checked) { #region theo ngày DateTime ngay; try { string date = new Common.Utilities().MyDateConversion(maskedTextBox1.Text); ngay = Convert.ToDateTime(date); } catch { MessageBox.Show("không đúng định dạng ngày!"); return; } switch (@select) { case 0: { frmBaoCaorpt bc = new frmBaoCaorpt(ngay, true, string.Empty, string.Empty); bc.ShowDialog(); } break; case 1: { //PDF SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "PDF |*.pdf", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(ngay, false, saveFileDialog1.FileName, "PDF"); } } break; case 2: { //DOC SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "Word |*.doc", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(ngay, false, saveFileDialog1.FileName, "Word"); } } break; case 3: { //XLS SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "Excel |*.xls", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(ngay, false, saveFileDialog1.FileName, "Excel"); } } break; } #endregion } else if (rdoTheoThang.Checked) { #region theo tháng int Thang, Nam; try { Thang = Convert.ToInt32(comboBox1.Text); Nam = dateTimePicker1.Value.Year; } catch (Exception ex) { MessageBox.Show("nhập sai định dạng ngày tháng", "Hệ thống cảnh báo"); maskedTextBox1.Focus(); return; } switch (@select) { case 0: { frmBaoCaorpt bc = new frmBaoCaorpt(Thang, Nam, true, string.Empty, string.Empty); bc.ShowDialog(); } break; case 1: { //PDF SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "PDF |*.pdf", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(Thang, Nam, false, saveFileDialog1.FileName, "PDF"); } } break; case 2: { //DOC SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "Word |*.doc", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(Thang, Nam, false, saveFileDialog1.FileName, "Word"); } } break; case 3: { //XLS SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "Excel |*.xls", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(Thang, Nam, false, saveFileDialog1.FileName, "Excel"); } } break; } #endregion } else if (rdoTheoNam.Checked) { #region theo năm DateTime Truoc, Sau; string date1 = "", date2 = ""; try { date1 = new Common.Utilities().MyDateConversion(maskedTextBox2.Text); Truoc = Convert.ToDateTime(date1); } catch (Exception ex) { MessageBox.Show("nhập sai định dạng ngày tháng", "Hệ thống cảnh báo"); maskedTextBox2.Focus(); return; } try { date2 = new Common.Utilities().MyDateConversion(maskedTextBox3.Text); Sau = Convert.ToDateTime(date2); } catch { MessageBox.Show("nhập sai định dạng ngày tháng", "Hệ thống cảnh báo"); maskedTextBox3.Focus(); return; } switch (@select) { case 0: { frmBaoCaorpt bc = new frmBaoCaorpt(Truoc, Sau, true, string.Empty, string.Empty); bc.ShowDialog(); } break; case 1: { //PDF SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "PDF |*.pdf", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(Truoc, Sau, false, saveFileDialog1.FileName, "PDF"); } } break; case 2: { //DOC SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "Word |*.doc", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(Truoc, Sau, false, saveFileDialog1.FileName, "Word"); } } break; case 3: { //XLS SaveFileDialog saveFileDialog1 = new SaveFileDialog { Filter = "Excel |*.xls", FileName = string.Empty }; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { frmBaoCaorpt bc = new frmBaoCaorpt(Truoc, Sau, false, saveFileDialog1.FileName, "Excel"); } } break; } #endregion } }
private void button1_Click(object sender, EventArgs e) { if (radioButton1.Checked) { DateTime Ngay; string date=""; try { date = new Common.Utilities().MyDateConversion(maskedTextBox1.Text); Ngay = Convert.ToDateTime(date); } catch { MessageBox.Show("ngay ko dung dinh dang"); return; } frmBaoCaorpt bc = new frmBaoCaorpt(Ngay); bc.ShowDialog(); } else if (radioButton2.Checked) { int Thang, Nam; try { Thang = Convert.ToInt32(comboBox1.Text); Nam = dateTimePicker1.Value.Year; } catch (Exception ex) { MessageBox.Show("nhập sai định dạng ngày tháng", "Hệ thống cảnh báo"); maskedTextBox1.Focus(); return; } frmBaoCaorpt bc = new frmBaoCaorpt(Thang,Nam); bc.ShowDialog(); } else if (radioButton3.Checked) { DateTime Truoc, Sau; string date1 = "", date2 = ""; try { date1 = new Common.Utilities().MyDateConversion(maskedTextBox2.Text); Truoc = Convert.ToDateTime(date1); } catch (Exception ex) { MessageBox.Show("nhập sai định dạng ngày tháng","Hệ thống cảnh báo"); maskedTextBox2.Focus(); return; } try { date2 = new Common.Utilities().MyDateConversion(maskedTextBox3.Text); Sau = Convert.ToDateTime(date2); } catch { MessageBox.Show("nhập sai định dạng ngày tháng", "Hệ thống cảnh báo"); maskedTextBox3.Focus(); return; } frmBaoCaorpt bc = new frmBaoCaorpt(Truoc, Sau); bc.ShowDialog(); } }
private void tsslin_Click(object sender, EventArgs e) { this.Enabled = false; Entities.KhachHang kh = GetThongTinKhachHang(txtMakhachhang.Text); try { string khachtra = "0"; if (txtkhachtra.Text == "") khachtra = "0"; else khachtra = txtkhachtra.Text; frmBaoCaorpt bcrpt = new frmBaoCaorpt("HDBanBuon", txtSochungtu.Text, Double.Parse(txtTongchietkhau.Text), khachtra, txtdutra.Text, txtTongtien.Text, txtGTGT.Text, lbnhanvien.Text, "", makNgaychungtu.Text, txtgiatrithe.Text, "0", "", txtChietkhau.Text, kh.DiaChi, txtnguoinhanhang.Text, txtDiengiai.Text); bcrpt.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; //if (i < 0) // return; try { Entities.BCNhapHangTheoNhom[] data = (Entities.BCNhapHangTheoNhom[])dtgvhienthi.DataSource; if (data == null) { return; } else if (data.Length == 0) { return; } //Xem string MaNhomHang = dtgvhienthi["MaNhomHang", i].Value.ToString(); List<Entities.BCNhapHangTheoNhomChiTiet> L = (from k in HIENTHIBAOCAO where k.MaNhomHang.Equals(MaNhomHang) select k).ToList(); frmBaoCaorpt a = new frmBaoCaorpt(L.ToArray(), thang.ToString(), nam.ToString()); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void tsslchitiet_Click(object sender, EventArgs e) { if (i < 0) return; try { string b = ""; string c = new DateTime(Convert.ToInt32(cbbnam.Text), Convert.ToInt32(cbbthang.Text), 1).ToString(); b = new DateTime(Convert.ToInt32(cbbnam.Text), Convert.ToInt32(cbbthang.Text), DateTime.DaysInMonth(Convert.ToInt32(cbbnam.Text), Convert.ToInt32(cbbthang.Text))).ToString(); //string c = "01/" + cbbthang.Text + "/" + cbbnam.Text; //if (cbbthang.Text == "12") // b = "01/01/" + (int.Parse(cbbnam.Text) + 1).ToString(); //else // b = "01/" + (int.Parse(cbbthang.Text) + 1).ToString() + "/" + cbbnam.Text; frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao.ToArray(), c, b, ""); a.ShowDialog(); } catch { } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (i < 0) return; try { string b = ""; string c = "01/" + cbbthang.Text + "/" + cbbnam.Text; if (cbbthang.Text == "12") b = "01/01/" + (int.Parse(cbbnam.Text) + 1).ToString(); else b = "01/" + (int.Parse(cbbthang.Text) + 1).ToString() + "/" + cbbnam.Text; frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao.ToArray(), c, b, ""); a.ShowDialog(); } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; try { ///////////////////////////////MRK FIX Hiển thị List<Entities.BCKhachHangTraHang> tem0 = ((Entities.BCKhachHangTraHang[])dtgvhienthi.DataSource).ToList(); //Entities.BCKhachHangTraHang dau = new Entities.BCKhachHangTraHang(); //dau = tem0[0]; Entities.BCKhachHangTraHang cuoi = new Entities.BCKhachHangTraHang(); cuoi = tem0[tem0.Count - 1]; //tem0.Remove(dau); tem0.Remove(cuoi); //////////////////////////////////////////////// hienthibaocao = tem0.ToArray(); //hienthibaocao = (Entities.BCKhachHangTraHang[])dtgvhienthi.DataSource; frmBaoCaorpt a = new frmBaoCaorpt(hienthibaocao, truoc, sau); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (i < 0) return; frmBaoCaorpt a = new frmBaoCaorpt("Nhom", dtgvhienthi["MaNhomHang", i].Value.ToString()); a.ShowDialog(); } catch { } }
private void tsslin_Click(object sender, EventArgs e) { try { ArrayList dulieu = new ArrayList(); Entities.HDThanhToanKH[] tem = new Entities.HDThanhToanKH[0]; tem = (Entities.HDThanhToanKH[])dtgvNCC.DataSource; if (tem.Length > 0) { List<Entities.BCPhieuTTCuaKH> tem1 = new List<Entities.BCPhieuTTCuaKH>(); foreach (Entities.HDThanhToanKH item in tem) { Entities.BCPhieuTTCuaKH bientam = new Entities.BCPhieuTTCuaKH(); bientam.MaDonHang = item.MaHDBanHang; bientam.TongTienHoaDon = double.Parse(item.TongTienThanhToan.Replace(",", "")); bientam.SoTienNo = double.Parse(item.SoNo.Replace(",", "")); bientam.ThanhToan = double.Parse(item.ThanhToan.Replace(",", "")); tem1.Add(bientam); } Entities.NhaCungCap kh = new Entities.NhaCungCap(); kh = laynhacungcap(txtmancc.Text); dulieu.Add(tem1); //dữ liệu trong datagridview (0) dulieu.Add(txtsochungtu.Text); //Mã phiếu (1) dulieu.Add(kh.TenNhaCungCap); //Tên nhà cung cấp (2) dulieu.Add(kh.DiaChi); //Địa chỉ (3) dulieu.Add(txtnguoinhaptien.Text); //Người nhận tiền (4) dulieu.Add(txtdiengiai.Text); //Diễn giải (5) dulieu.Add(txttongthanhtoan.Text); //Tổng thanh toán (6) frmBaoCaorpt a = new frmBaoCaorpt("InPhieuThanhToanCuaNCC", dulieu); a.ShowDialog(); } } catch { } }
private void tsslchitiet_Click(object sender, EventArgs e) { this.Enabled = false; try { if (i < 0) return; frmBaoCaorpt a = new frmBaoCaorpt("Nhom", dtgvhienthi["MaNhomHang", i].Value.ToString()); a.ShowDialog(); } catch { } finally { this.Enabled = true; } }
private void dtgvhienthi_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dtgvhienthi.RowCount > 1) { try { frmBaoCaorpt a = new frmBaoCaorpt("KhachHang"); a.ShowDialog(); } catch { } } }