public static int ThemLoaiNV(LoaiNhanVien_DTO loaiNV) { Provider provider = new Provider(); string sql = string.Format("insert into LoaiNV(MaLoai,TenLoai,Luong) values ('{0}','{1}',{2})", loaiNV.MaLoaiNV, loaiNV.TenLoaiNV, loaiNV.Luong); SqlCommand cm = provider.CreateCommandStringSql(sql); return provider.ExecuteInsertUpdateDelete(cm); }
public static int CapNhatLoaiNhanVien(LoaiNhanVien_DTO loaiNV) { Provider provider = new Provider(); string sql = string.Format("update LoaiNV set TenLoai=N'{0}' where MaLoai='{1}'", loaiNV.TenLoaiNV, loaiNV.MaLoaiNV); SqlCommand cm = provider.CreateCommandStringSql(sql); return provider.ExecuteInsertUpdateDelete(cm); }
public void CapNhatLoaiNhanVien() { int flag = 0; int[] index = gridView_LoaiNV.GetSelectedRows(); if (index.Length > 0) { string tenloai = gridView_LoaiNV.GetRowCellValue(index[0], "TenLoai").ToString(); string maloai = gridView_LoaiNV.GetRowCellValue(index[0], "MaLoai").ToString(); if (maloai != null) { DTO.LoaiNhanVien_DTO loaiNV = new LoaiNhanVien_DTO(); loaiNV.MaLoaiNV = maloai; loaiNV.TenLoaiNV = tenloai; flag = LoaiNhanVien_BUS.CapNhatLoaiNhanVien(loaiNV); } } if (flag != 0) DevExpress.XtraEditors.XtraMessageBox.Show("Cập nhật thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public static int ThemLoaiNV(LoaiNhanVien_DTO loaiNV) { return LoaiNhanVien_DAO.ThemLoaiNV(loaiNV); }
public static int CapNhatLoaiNhanVien(LoaiNhanVien_DTO loaiNV) { return LoaiNhanVien_DAO.CapNhatLoaiNhanVien(loaiNV); }