Esempio n. 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        product c = new product(TextBox1.Text, TextBox2.Text, TextBox3.Text, 100000, 1001);
        int     s = in1.add(c);

        // cmd.CommandType = CommandType.StoredProcedure;
        // cmd.CommandText = "c_ad";
        // cmd.Connection = con;
        // cmd.Parameters.AddWithValue("@pid", 0);
        // cmd.Parameters.AddWithValue("@cname", TextBox1.Text);
        // cmd.Parameters.AddWithValue("@Colors", TextBox2.Text);
        // cmd.Parameters.AddWithValue("@description", TextBox3.Text);
        // cmd.Parameters.AddWithValue("@price", TextBox4.Text);
        // cmd.Parameters.AddWithValue("@ctid", TextBox5.Text);
        // cmd.Parameters.AddWithValue("@Isactive", TextBox6.Text);
        // cmd.Parameters["@pid"].Direction = ParameterDirection.Output;
        //int s1 = cmd.ExecuteNonQuery();
        // con.Close();
        // int ii = 1;
        Response.Write("<script>alert('hello'+'" + s + "')</script>");
    }
Esempio n. 2
0
    private bool handleProduceData(ProduceData data)
    {
        if (this.storedEnergy < data.energyCost * Time.deltaTime)
        {
            return(false);
        }

        foreach (var elem in data.consume)
        {
            var scaled = elem.clone();
            scaled.setAmount(scaled.getAmount() * Time.deltaTime);
            if (!inventory.canTake(scaled))
            {
                return(false);
            }
        }

        //has enough energy and ressources!
        this.storedEnergy -= data.energyCost * Time.deltaTime;

        foreach (var elem in data.consume)
        {
            var scaled = elem;
            scaled.setAmount(scaled.getAmount() * Time.deltaTime);
            inventory.remove(scaled);
        }

        //create outcome/energy
        this.storedEnergy += data.energyProduce *= Time.deltaTime;

        foreach (var elem in data.outcome)
        {
            var scaled = elem;
            scaled.setAmount(scaled.getAmount() * Time.deltaTime);
            inventory.add(scaled);
        }

        return(true);
    }
Esempio n. 3
0
 public void transfer(inventory target, ressourceStack stack)
 {
     target.add(stack);
     this.remove(stack);
 }
Esempio n. 4
0
 public void unequip(items obj)
 {
     inv.add(obj);
     Equip.Remove(obj);
 }