private string GenerateBookId() { DataTable dataTable = bUS.GetDatasByCommand("SELECT MaSach FROM SACH ORDER BY MaSach"); int oldBookId = int.Parse(dataTable.Rows[dataTable.DefaultView.Count - 1]["MaSach"].ToString().Substring(1, 3)); oldBookId++; string newBookId = "S" + oldBookId.ToString("000"); return(newBookId); }
DataTable LoadDsSach() { SachBUS bus = new SachBUS(); string str = "SELECT MaSach FROM SACH"; return(bus.GetDatasByCommand(str)); }