Note that there are some explanatory texts on larger screens.

plurals
  1. POObject Oriented Approach for C#
    text
    copied!<p>I am exploring this and see if this one make sense. For instance I have 2 abstract objects called: Customer and Tender. The relationship is that one Customer can have many Tenders. </p> <p>How can I achieve the following on the TestClient app:</p> <ol> <li><p><code>customer.InTender[0].ID = ???</code></p> <p>What method to handle to handle this? Do I need to pass <code>CustomerID</code> into <code>Customer</code> constructor to achieve this or ... ?</p></li> <li><p>If I want to get all tenders for that particular customer should I do this:</p> <pre><code>customer.InTender.Get() </code></pre></li> <li><p>How do I differentiate between All Tender VS All Customer Tender (point 3). I guess it will be like this. One with ID of Customer and the other one without?</p> <pre><code>inTender.Get() </code></pre></li> </ol> <hr> <pre><code>public abstract class Customer { protected Int64 id; protected string name; protected ArrayList tender; public abstract ArrayList Tender { get; set; } public abstract Int64 ID { get; set; } public abstract string Name { get; set; } public abstract bool Update(); public abstract bool Add(); public abstract bool Delete(); } public class CorporateCustomer : Customer { public CorporateCustomer () {} public override ArrayList Tender { get { return tender } set { tender = value; } } public override Int64 ID { get { return id; } set { id = value; } } public override string Name { get { return name; } set { name = value; } } public override bool Update() { return true; } public override bool Add() { return true; } public override bool Delete() { return true; } } public abstract class Tender { protected Int64 id; protected string name; public abstract bool Update(); public abstract bool Add(); public abstract bool Delete(); } public class InTender : Tender { public InTender () {} public override Int64 ID { get { return id; } set { id = value; } } public override string Name { get { return name; } set { name = value; } } public override bool Update() { return true; } public override bool Add() { return true; } public override bool Delete() { return true; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload