Пример #1
0
        //ค้นหาข้อมูลประเภทอาหาร
        public SqlDataReader getFoodcategory(clsFood_category objcategory)
        {
            SqlDataReader dr;

            sql = "select * from Food_category";

            dr = objDatabase.ExecDataSearch(sql);
            return dr;
        }
Пример #2
0
        //ค้นหาข้อมูลตามประเภทอาหาร
        public SqlDataReader getFoodcategoryByname(clsFood_category objcategory)
        {
            SqlDataReader dr;

            sql = "select * from Food_category";
            sql = sql + " where Food_category_name like '%" + objcategory.Food_category_name + "%'";

            dr = objDatabase.ExecDataSearch(sql);
            return dr;
        }
Пример #3
0
 public Boolean Checkvalidate(clsFood_category objCategory)
 {
     if (objCategory.Food_category_code == "" || objCategory.Food_category_name == "")
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Пример #4
0
        //การคืนค่าแบบไหน เช่น แบบ boolean, void ,String ,int
        public Boolean addFood_category(clsFood_category objcategory)
        {
            try
            {
                sql = "Insert into Food_category values ( ";
                sql = sql + "'" + objcategory.Food_category_code + "'";
                sql = sql + ",'" + objcategory.Food_category_name + "')";

               // return objDatabase.ExecData(sql);

                result = objDatabase.ExecData(sql);
                return result;
            }
            catch
            {
              //  return false;
                return result;                //แบบที่ 2
            }
        }
Пример #5
0
 public SqlDataReader SearchFoodcategoryByname(clsFood_category objCategory)
 {
     return objCategoryDAL.getFoodcategoryByname(objCategory);
 }
Пример #6
0
 public Boolean SaveCategory(clsFood_category objCategory)
 {
     return objCategoryDAL.addFood_category(objCategory);
 }