示例#1
0
 public void DeleteCataByID(CatalogueDO CataDO)
 {
     string query = "delete from Catalogue where Catalogue_ID='" + CataDO.Catalogue_ID + "'";
     if (DA.DeleteDatabase(query))
     {
         MessageBox.Show("Xóa chủ đề thành công");
     }
 }
示例#2
0
        //Query insert command to add catalogue into database
        public void InsertCata(CatalogueDO CataDO)
        {
            string query = "INSERT INTO Catalogue(Catalogue_ID,Catalogue_Name)"
                         + " VALUES ('" + CataDO.Catalogue_ID + "','" + CataDO.Catalogue_Name + "')";

            if (CatalogueExist(CataDO) == true)
            {
                MessageBox.Show("Chủ đề đã tồn tại", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                DA.InsertDatabase(query);
            }
        }
示例#3
0
        //Check catalogue have exist in database
        public bool CatalogueExist(CatalogueDO CataDO)
        {
            string query = "SELECT * FROM Catalogue"
                         + " WHERE Catalogue_Name = '" + CataDO.Catalogue_Name.ToUpper() + "'";

            DataTable dtb = DA.SelectDatabase(query);
            if (dtb.Rows.Count != 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
示例#4
0
 public void EditCataByID(CatalogueDO CataDO)
 {
     string query = "UPDATE Catalogue SET Catalogue_Name = '" + CataDO.Catalogue_Name + "'"
                  + "WHERE Catalogue_ID ='" + CataDO.Catalogue_ID + "'";
     DA.UpdateDatabase(query);
 }