public food Delete_food_select(int ID)
 {
     food = food.Select(ID);
     Delete_food_voucher_id_txt_lbl.Text = Convert.ToString(food.food_voucher_id);
     Delete_clients_served_txt_lbl.Text = Convert.ToString(food.clients_served);
     Delete_food_voucher_number_txt_lbl.Text = Convert.ToString(food.food_voucher_number);
     Delete_date_issued_txt_lbl.Text = Convert.ToString(food.date_issued);
     Delete_Product_id_txt_lbl.Text = Convert.ToString(food.Product_id);
     return food;
 }
Example #2
0
		public void mappingValue(food thisType){
			if (thisType == food.banana) {
				this.dmg = 10f;
				this.health = 60f;
			} else if (thisType == food.apple) {
				this.dmg = 8f;
				this.health = 40f;
			} else if (thisType == food.strawberry) {
				this.dmg = 5f;
				this.health = 30f; 
			}
		}
 public food food_insert()
 {
     food.clients_served = Convert.ToInt32(Insert_clients_served_txt.Text);
     food.food_voucher_number = Convert.ToInt32(Insert_food_voucher_number_txt.Text);
     food.date_issued = Convert.ToDateTime(Insert_date_issued_txt.Text);
     food.Product_id = Convert.ToInt32(Insert_Product_id_txt.Text);
     food = food.Insert(food);
     Insert_food_GridView.DataBind();
     Update_food_GridView.DataBind();
     Delete_food_GridView.DataBind();
     return food;
 }
 public food food_update(int ID)
 {
     food = food.Select(ID);
     food.food_voucher_id = Convert.ToInt32(Update_food_voucher_id_txt.Text);
     food.clients_served = Convert.ToInt32(Update_clients_served_txt.Text);
     food.food_voucher_number = Convert.ToInt32(Update_food_voucher_number_txt.Text);
     food.date_issued = Convert.ToDateTime(Update_date_issued_txt.Text);
     food.Product_id = Convert.ToInt32(Update_Product_id_txt.Text);
     food.Update(food);
     Insert_food_GridView.DataBind();
     Update_food_GridView.DataBind();
     Delete_food_GridView.DataBind();
     return food;
 }
Example #5
0
    public void mappingValue(food thisType)
    {
        if (thisType == food.banana)
        {
            this.dmg = 1f;
            this.health = 60f;
            this.originalHealth = 60f;
			this.moneyValue = 10;
        }
        else if (thisType == food.apple)
        {
            this.dmg = 4f;
            this.health = 200f;
            this.originalHealth = 200f;
			this.moneyValue = 20;
        }
        else if (thisType == food.strawberry)
        {
            this.dmg = 1.5f;
            this.health = 30f;
            this.originalHealth = 30f;
			this.moneyValue = 15;
        }
        else if(thisType == food.Burger)
        {
            this.dmg = 2f;
            this.health = 200f;
            this.moneyValue = 200;
            this.originalHealth = 200f;

        }
        else if(thisType == food.icecream)
        {
            this.dmg = 0.5f;
            this.health = 50f;
            this.originalHealth = 50f;
            this.moneyValue = 80;
        }
    }
Example #6
0
		public minion(food thisType){
			this.thisType = thisType;
			mappingValue (thisType);
			//should have a method to map the corresponding heal and dmg to each type
		}
 private int costList(food foodType)
 {
     if (foodType == food.banana)
         return 50;
     else if (foodType == food.strawberry)
         return 100;
     else if (foodType == food.apple)
         return 150;
     else if (foodType == food.tower) return 300;
     return 0;
 }
 protected void Update_Select_Record(object sender, EventArgs e)
 {
     food = Update_food_select(Convert.ToInt32(Update_food_GridView.SelectedValue));
 }
 protected void UPDATE(object sender, EventArgs e)
 {
     food = food_update(Convert.ToInt32(Update_food_GridView.SelectedValue));
 }
 protected void Insert_Select_Record(object sender, EventArgs e)
 {
     food = Insert_food_select(Convert.ToInt32(Insert_food_GridView.SelectedValue));
 }
 protected void INSERT(object sender, EventArgs e)
 {
     food = food_insert();
 }