void addMaDGToCB() { DocGiaDAO dg = new DocGiaDAO(); cbMaDGMuon.DataSource = dg.GetListDocGia(); cbMaDGMuon.DisplayMember = "MaDG"; }
string TaoMaDGMoi() { DocGiaDAO book = new DocGiaDAO(); string old = book.getMaxMaDG(); old = old.TrimStart('D'); old = old.TrimStart('G'); int newCode = int.Parse(old); newCode += 1; string code = "DG"; if (newCode < 10) { code = code + "00" + newCode; } else if (newCode < 100) { code = code + "0" + newCode; } else { code = code + newCode; } return(code); }
private void txtMaDGTk_TextChanged(object sender, EventArgs e) { DocGiaDAO dg = new DocGiaDAO(); DocGia d = dg.GetNameDG(txtMaDGTk.Text); txtTenDGtk.Text = d.HoTen; txtMsvtk.Text = d.MaSV.ToString(); }
private void txtSerchDG_TextChanged(object sender, EventArgs e) { if (rabMaDG.Checked == true) { DocGiaDAO dg = new DocGiaDAO(); docgiaList.DataSource = dg.GetListDGByMaDG(txtSerchDG.Text); } if (rabMaSV.Checked == true) { DocGiaDAO dg = new DocGiaDAO(); docgiaList.DataSource = dg.GetListDGByMaSV(txtSerchDG.Text); } }
public static List <DocGiaDTO> GetReaders(LoaiDGDTO loaiDG) { List <DocGiaDTO> docGias = DocGiaDAO.SelecReaders(loaiDG); foreach (DocGiaDTO docGia in docGias) { if (0 < docGia.Ngaymo.Ticks && docGia.Ngaymo.Ticks < DateTime.Now.Ticks) { docGia.Ngaymo = docGia.Ngaymo.AddTicks(-docGia.Ngaymo.Ticks); docGia.Ngaykhoa = docGia.Ngaykhoa.AddTicks(-docGia.Ngaykhoa.Ticks); } DocGiaDAO.UnBlockReader(docGia); } return(docGias); }
private void btnDeleteDG_Click(object sender, EventArgs e) { string madg = txtMaDG.Text; DocGiaDAO dg = new DocGiaDAO(); if (dg.DeleteDG(madg)) { MessageBox.Show("Xóa độc giả thành công"); ShowDG(); } else { MessageBox.Show("có lỗi khi xóa dộc giả"); } }
private void btnSearchPeople_Click(object sender, EventArgs e) { txtName.Text = ""; lvSearch.Columns.Clear(); lvSearch.Items.Clear(); if (radMaDG.Checked == true) { SearchByMaDG(txtSearchPeople.Text); DocGiaDAO dg = new DocGiaDAO(); DocGia docgia = dg.GetNameDG(txtSearchPeople.Text); txtName.Text = docgia.HoTen; } if (rabMaSV.Checked == true) { DocGiaDAO dg = new DocGiaDAO(); DocGia docgia = dg.GetNameDGByMsv(txtSearchPeople.Text); txtName.Text = docgia.HoTen; SearchByMaSV(txtSearchPeople.Text); } }
public static int LockOrUnlock(ref DocGiaDTO docGia, int month) { if (month > -1) { docGia.Ngaykhoa = DateTime.Now; if (month != 0) { docGia.Ngaymo = docGia.Ngaykhoa.AddMonths(month); } else { docGia.Ngaymo = docGia.Ngaymo.AddTicks(-docGia.Ngaymo.Ticks); } } else { docGia.Ngaykhoa = docGia.Ngaykhoa.AddTicks(-docGia.Ngaykhoa.Ticks); docGia.Ngaymo = docGia.Ngaymo.AddTicks(-docGia.Ngaymo.Ticks); } return(DocGiaDAO.UnBlockReader(docGia)); }
private void btnEditDG_Click(object sender, EventArgs e) { string madg = txtMaDG.Text; string hoten = txtTenDG.Text; int masv = int.Parse(txtMsv.Text); string tenkhoa = txtTenKhoa.Text; DateTime ngaysinh = dateTimeNgaySinhDG.Value; string diachi = txtDC.Text; DateTime ngaylapthe = dateTimeNgayLT.Value; DocGiaDAO dg = new DocGiaDAO(); if (dg.EditDG(madg, hoten, masv, ngaysinh, tenkhoa, diachi, ngaylapthe)) { MessageBox.Show("Sửa độc giả thành công"); ShowDG(); } else { MessageBox.Show("Có lỗi khi thêm dộc giả"); } }
public static int ThemDocGia(DocGiaDTO dg) { return(DocGiaDAO.ThemDocGia(dg)); }
public static int XoaDocGia(string SoThe) { return(DocGiaDAO.XoaDocGia(SoThe)); }
public static DataTable LoadDgvDocGia(string proc) { return(DocGiaDAO.LoadDgvDocGia(proc)); }
public static void Insert(DocGiaDTO docgiaDTO) { DocGiaDAO docgiaDAO = new DocGiaDAO(); DocGiaDAO.Insert(docgiaDTO); }
public void Update(DocGiaDTO docgiaDTO) { DocGiaDAO docgiaDAO = new DocGiaDAO(); docgiaDAO.UpdateDocGia(docgiaDTO); }
public static void DeleteDocGia(int idDG) { DocGiaDAO.DeleteDocGia(idDG); }
public static Array LoadDocGia() { var docGias = DocGiaDAO.LoadDocGia(); return(docGias); }
public static void AddDocGia(string tenDG, int idLoaiDG, DateTime ngaySinh, string diaChi, string email, DateTime ngayLapThe) { DocGiaDAO.AddDocGia(tenDG, idLoaiDG, ngaySinh, diaChi, email, ngayLapThe, 0); }
public static int AddReader(string ten, string phone, LoaiDGDTO loai) { return(DocGiaDAO.InserReader(new DocGiaDTO(ten, phone, loai))); }
public static int ChangeInfReader(string madg, string ten, string sdt, LoaiDGDTO loai) { return(DocGiaDAO.UpdatReader(new DocGiaDTO(madg, ten, sdt, loai))); }
public static IList FindAll() { return(DocGiaDAO.FindAll()); }
public static int SuaDocGia(DocGiaDTO dg) { return(DocGiaDAO.SuaDocGia(dg)); }
void ShowDG() { DocGiaDAO dg = new DocGiaDAO(); docgiaList.DataSource = dg.GetListDocGia(); }
public static List <DOCGIA> GetDocGias() { var docGias = DocGiaDAO.GetDocGias(); return(docGias); }
public static DOCGIA FindDocGiaById(int idDocGia) { return(DocGiaDAO.FindDocGiaById(idDocGia)); }
public static void UpdateNo(int idDocGia, double conLai) { DocGiaDAO.UpdateNo(idDocGia, conLai); }
public static void UpdateDocGia(int idDocGia, string tenDG, int idLoaiDG, DateTime ngaySinh, string diaChi, string email, DateTime ngayLapThe) { DocGiaDAO.UpdateDocGia(idDocGia, tenDG, idLoaiDG, ngaySinh, diaChi, email, ngayLapThe, 0); }
public void GetDocGia(DocGiaDTO DocGiaDTO) { DocGiaDAO docgiaDAO = new DocGiaDAO(); docgiaDAO.GetDocGia(DocGiaDTO); }
public static IList FindDocGia(int idDG, string tenDocGia, string tenLoaiDocGia, DateTime ngaySinh, string diaChi, string email, DateTime ngayLapThe) { return(DocGiaDAO.FindDocGia(idDG, tenDocGia, tenLoaiDocGia, ngaySinh, diaChi, email, ngayLapThe)); }