//更新
 //public bool UpdateProducts(int PID,int CategoryID,string Name,string Description)
 //{
 //    if (helper.ExcuteCommandInt("update Products set CategoryID=" + CategoryID + ",Name='" + Name + "',Description='" + Description + "' where PID=" + PID + "") > 0)
 //        return true;
 //    else
 //        return false;
 //}
 public bool UpdateProducts(Entity.Products product)
 {
     if (helper.ExcuteCommandInt("update Products set CategoryID=" 
         +product.getCategoryID()+ ",Name='" 
         +product.getName()+ "',Description='" 
         +product.getDescription()+ "' where PID="
         + product.getPID() + "") > 0)
         return true;
     else
         return false;
 }
 //新增
 //public bool AddProduct(int CategoryID,string Name,string Description) {
 //    if (helper.ExcuteCommandInt("insert into Products(CategoryID,Name,Description) values("+CategoryID+",'"+Name+"','"+Description+"')") > 0)
 //        return true;
 //    else
 //        return false;
 //}
 public bool AddProduct(Entity.Products product)
 {
     //int CategoryID, string Name, string Description
     if (helper.ExcuteCommandInt("insert into Products(CategoryID,Name,Description) values(" 
         + product.getCategoryID() + ",'" 
         + product.getName()+ "','" 
         +product.getDescription() + "')") > 0)
         return true;
     else
         return false;
 }
Example #3
0
    void Update() {
        if (woodCount != null)
            woodCount.text = Game.wood.ToString();

        if (stoneCount != null)
            stoneCount.text = Game.stone.ToString();

        if (Input.GetMouseButtonDown(0) && InputEnabled) {
            RaycastHit hit;
            if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 1000f, /*villagerLayer))/**/ (1 << 0x09) | (1 << 0x0A))){
                selected = hit.collider.GetComponent<Entity>();
                if(selected!=null)
                detailName.text = selected.getName();

                //details.SetActive(true);

                if (selected is Villager) {

                }
            } else {
                selected = null;
                //details.SetActive(false);
            }
        }

        if (day == 7) {
            if (!awaitingRitual)
                Attack();
        }
    }