public void LoadData() { maTDMoi = DoAnQLKaraokeBUS.ThucDonBUS.MaThucDonMoi(); //trThai = 1; //TrangThai(); LoaiThucDonBUS lp = new LoaiThucDonBUS(); cbo_Loai.DataSource = lp.DanhSachLoaiTD().FindAll(o => o.TINHTRANG == true); cbo_Loai.ValueMember = "MALOAITD"; cbo_Loai.DisplayMember = "TEN"; TinhTrangTDBUS tt = new TinhTrangTDBUS(); cbo_TT.DataSource = tt.DSTINHTRANGTD(); cbo_TT.ValueMember = "MATTR"; cbo_TT.DisplayMember = "TENTTR"; //load datagridviewcomboboxcolum truoc khi load ds . DataGridViewComboBoxColumn dgv_LoaiTD = (DataGridViewComboBoxColumn)dgv_ThucDon.Columns["colLOAITD"]; dgv_LoaiTD.DataSource = lp.DanhSachLoaiTD().FindAll(o => o.TINHTRANG == true); dgv_LoaiTD.ValueMember = "MALOAITD"; dgv_LoaiTD.DisplayMember = "TEN"; DataGridViewComboBoxColumn dgvcb_tinhtrang = (DataGridViewComboBoxColumn)dgv_ThucDon.Columns["colTINHTRANG"]; dgvcb_tinhtrang.DataSource = tt.DSTINHTRANGTD(); dgvcb_tinhtrang.ValueMember = "MATTR"; dgvcb_tinhtrang.DisplayMember = "TENTTR"; //DataGridViewCheckBoxColumn dgvckb = (DataGridViewCheckBoxColumn)dgv_sanpham.Columns["TinhTrang"]; ThucDonBUS b = new ThucDonBUS(); dgv_ThucDon.DataSource = b.DanhSachTD(); }
protected void ChiTietLoaiThucDon() { LoaiThucDonBUS loaiThucDonBUS = new LoaiThucDonBUS(); LoaiThucDonDTO LoaiThucDon = loaiThucDonBUS.ChiTietLoaiThucDon(int.Parse(Request["MaLoaiThucDon"].ToString())); XL_THE Kq1 = new XL_THE("loai_thuc_don"); Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("MaLoaiThucDon", LoaiThucDon.Ma_loai_thuc_don.ToString())); Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("TenLoaiThucDon", LoaiThucDon.Ten_loai_thuc_don)); Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("MaLoaiThucDonCha", LoaiThucDon.Ma_loai_thuc_don_cha.ToString())); Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("LaLoaiThucDonLa", LoaiThucDon.La_loai_thuc_don_la.ToString())); XL_CHUOI.XuatXML(Response, Kq1.Chuoi()); }
private void btn_luu_Click(object sender, EventArgs e) { LoaiThucDonBUS a = new LoaiThucDonBUS(); if (trThai == 2) { LoaiThucDonDTO loai; try { loai = new LoaiThucDonDTO() { MALOAITD = int.Parse(txt_MaLoai.Text), TEN = txt_TenLoai.Text, TINHTRANG = ckb_TinhTrang.Checked ? true : false }; } catch { MessageBox.Show("Thieu thong tin"); return; } bool kt = a.CapNhatLoai(loai); if (!kt) { MessageBox.Show("Cập nhật thất bại"); } else { FrmChinh frmmain = (FrmChinh)this.MdiParent; frmmain.lsNDDTO = new LichSuNguoiDungDTO() { MAND = frmmain.nvDangNhap.MAND, MANV = frmmain.nvDangNhap.MANV, THOIGIAN = DateTime.Parse(DateTime.Now.ToString("dd/MM/yyy HH:mm")), SUKIEN = "Cập nhật loại thực đơn " + loaiTD.TEN + " => " + txt_TenLoai.Text }; bool ktls = frmmain.lsNDBUS.ThemLichSuNguoiDung(frmmain.lsNDDTO); MessageBox.Show("Cập nhật thành công!"); trThai = 1; loaiTD = null; } } TrangThai(); Bind(); LoadData(); }
protected void LayDSLoaiThucDonGoc() { LoaiThucDonBUS loaiThucDonBUS = new LoaiThucDonBUS(); LoaiThucDonDTO[] dsLoaiThucDon = loaiThucDonBUS.LayDanhSachLoaiThucDonRoot(); XL_THE Kq = new XL_THE("dsLoaiThucDon"); for (int i = 0; i < dsLoaiThucDon.Length; ++i) { XL_THE Kq1 = new XL_THE("LoaiThe"); Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("MaLoaiThucDon", dsLoaiThucDon[i].Ma_loai_thuc_don.ToString())); Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("TenLoaiThucDon", dsLoaiThucDon[i].Ten_loai_thuc_don)); Kq.Danh_sach_the.Add(Kq1); } XL_CHUOI.XuatChuoi(Response, Kq.Chuoi()); }
void LayDanhSachThucDon() { // Xử lý request int pageSize = 10; if (Request["results"] != null) { pageSize = int.Parse((string)Request["results"]); } int pageNum = 1; if (Request["startIndex"] != null) { pageNum = (int.Parse((string)Request["startIndex"]) / pageSize) + 1; } ThucDonBUS bus = new ThucDonBUS(); ThucDonDTO[] kq = bus.DanhSachThucDon(pageNum, pageSize); LoaiThucDonBUS ltdBus = new LoaiThucDonBUS(); int tongSoThucDon = bus.TongSoThucDon(); XL_THE Kq = new XL_THE("DANH_SACH"); XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("totalRecords", tongSoThucDon.ToString()); Kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); foreach (ThucDonDTO dto in kq) { XL_THE the = new XL_THE("ThucDon"); Thuoc_tinh = new XL_THUOC_TINH("MaThucDon", dto.Ma_thuc_don.ToString()); the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); Thuoc_tinh = new XL_THUOC_TINH("TenThucDon", dto.Ten_thuc_don); the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); LoaiThucDonDTO ltdDto = ltdBus.ChiTietLoaiThucDon(dto.Ma_loai_thuc_don); Thuoc_tinh = new XL_THUOC_TINH("LoaiThucDon", ltdDto.Ten_loai_thuc_don); the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); Thuoc_tinh = new XL_THUOC_TINH("MoTa", dto.Mo_ta); the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); Thuoc_tinh = new XL_THUOC_TINH("HinhAnhMinhHoa", dto.Hinh_anh_minh_hoa); the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); Thuoc_tinh = new XL_THUOC_TINH("Gia", dto.Gia.ToString()); the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); Thuoc_tinh = new XL_THUOC_TINH("TrangThaiHienThi", dto.Trang_thai_hien_thi ? "1" : "0"); the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); Thuoc_tinh = new XL_THUOC_TINH("TinhTrang", dto.Tinh_trang ? "1" : "0"); the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh); Kq.Danh_sach_the.Add(the); } XL_CHUOI.XuatXML(Response, Kq.Chuoi()); }
private void LoadData() { LoaiThucDonBUS b = new LoaiThucDonBUS(); dgv_LoaiTD.DataSource = b.DanhSachLoaiTD(); }