private void loadDetail(LePhuc lephuc) { txtMaLP.Text = _lephuchientai.MaLePhuc.ToString(); dtimeNgaynhap.Text = _lephuchientai.NgayNhap.ToString(); txtMota.Text = _lephuchientai.MoTa; txtGianhap.Text = _lephuchientai.GiaNhap.ToString(); txtGiachothue.Text = _lephuchientai.GiaChoThue.ToString(); txtTinhTrang.Text = (string)TinhTrangLePhucDAO.Instance.GetTentihtrangByMatinhtrang((int)_lephuchientai.TinhTrang); cboxTinhtrang.Text = (string)TinhTrangLePhucDAO.Instance.GetTentihtrangByMatinhtrang((int)_lephuchientai.TinhTrang); picHinhanh.Image = ControlUtils.convertByteToImage(_lephuchientai.HinhAnh); picHinhanh.SizeMode = PictureBoxSizeMode.Zoom; }
public List <LePhuc> getlephuclist() { List <LePhuc> list = new List <LePhuc>(); var query = "select LEPHUC.*, LOAILEPHUC.TenLoaiLP , TINHTRANG.TenTinhTrang from LEPHUC, LOAILEPHUC, TINHTRANG where LEPHUC.Loai=LOAILEPHUC.MaLoaiLP and TINHTRANG.MaTinhTrang=LEPHUC.TinhTrang"; DataTable datatable = DataProvider.Instance.ExecuteQuery(query); foreach (DataRow row in datatable.Rows) { LePhuc lephuc = new LePhuc(row); list.Add(lephuc); } return(list); }
public List <LePhuc> getLephucByloaiLephucAndTinhtrang(int loailp, int tinhtrang) { var list = new List <LePhuc>(); var query = string.Format("select * from LEPHUC where Loai = {0} and TinhTrang={1}", loailp, tinhtrang); var datatable = DataProvider.Instance.ExecuteQuery(query); foreach (DataRow row in datatable.Rows) { var lephuc = new LePhuc(row); list.Add(lephuc); } return(list); }
public List <LePhuc> LoadLephucList() { var list = new List <LePhuc>(); var query = string.Format("select * from LEPHUC"); var datatable = DataProvider.Instance.ExecuteQuery(query); foreach (DataRow row in datatable.Rows) { var lephuc = new LePhuc(row); list.Add(lephuc); } return(list); }
private void ChangeSelectedIndexLePhuc() { try { var malp = _cthdlephucList[dgvCTHD_Lephuc.SelectedRows[0].Index].MaLePhuc; _lephuchientai = LePhucDAO.Instance.getLephucByMaLephuc(malp); picHinhanh.Image = ControlUtils.convertByteToImage(_lephuchientai.HinhAnh); txtMota.Text = _lephuchientai.MoTa.ToString(); if (!(HoaDonDAO.Instance.DaInHoaDon(_hoadon.MaHD))) { // btnAdd.Enabled = false; btnDelete.Enabled = true; } } catch { } }
void pic_Click(object sender, EventArgs e) { if (curPic != null) { //đổi hiệu ứng chọn lại bình thường curPic.BackColor = Color.Transparent; } PictureBox choosingPic = (PictureBox)sender; //đổi hiệu ứng pic đang chọn choosingPic.BackColor = Color.Aqua; curPic = choosingPic; _lephuchientai = (LePhuc)((PictureBox)sender).Tag; }
private void loadpictureboxInflplephuc() { if (_lephuclist.Count != 0) { foreach (LePhuc row in _lephuclist) { PictureBox pic = new PictureBox() { Height = 200, Width = 150 }; pic.Click += pic_Click; pic.Tag = row; pic.DataBindings.Add("Image", row, "HinhAnh", true, DataSourceUpdateMode.Never); pic.SizeMode = PictureBoxSizeMode.Zoom; pic.Cursor = Cursors.Hand; flpLephuc.Controls.Add(pic); } _lephuchientai = _lephuclist[0]; } }
public XEMHOADONLEPHUC(LePhuc lephuc) { InitializeComponent(); this._lephuc = lephuc; }
public ChonlephucEvent(LePhuc lephuc) { this.Lephuc = lephuc; }