Click here to Skip to main content
15,885,366 members
Home / Discussions / C#
   

C#

 
AnswerRe: Enumerating a class Pin
PIEBALDconsult22-May-09 4:24
mvePIEBALDconsult22-May-09 4:24 
GeneralRe: Enumerating a class Pin
CodingYoshi22-May-09 4:44
CodingYoshi22-May-09 4:44 
QuestionComboBox not autoresizing on rebind of datasource Pin
Paul.B22-May-09 3:24
Paul.B22-May-09 3:24 
AnswerRe: ComboBox not autoresizing on rebind of datasource Pin
CodingYoshi22-May-09 3:58
CodingYoshi22-May-09 3:58 
GeneralRe: ComboBox not autoresizing on rebind of datasource Pin
Paul.B22-May-09 5:42
Paul.B22-May-09 5:42 
GeneralRe: ComboBox not autoresizing on rebind of datasource Pin
CodingYoshi22-May-09 8:07
CodingYoshi22-May-09 8:07 
GeneralRe: ComboBox not autoresizing on rebind of datasource Pin
Paul.B25-May-09 22:56
Paul.B25-May-09 22:56 
QuestionSearch in List<t></t> Pin
arturw8222-May-09 3:21
arturw8222-May-09 3:21 
I have classes as these below,
and I have myList List<cost>,
myList.Add(new Materials),
myList.Add(new PlannedOperation)
I have to implement searching in List<cost>, but I do not know exactly how.
For example I want to find: Cost where type of cost is Materials and orderNumber = "000001"
or Cost where type of cost is PlannedOperation and value > 50000
I should have in the result List<cost>, or maybe List<materials>, List<plannedoperation> ...?:/
Thanks for Your help.


  public abstract class Cost
  {
      private Int32 id;

      public Cost()
      {
      }
      public abstract override string ToString();

      public Task Task
      {
          get
          {
              return this.m_task;
          }
          set
          {
              this.m_task = value;
          }
      }
      public Int32 Id
      {
          get
          {
              return this.id;
          }
          set
          {
              this.id = value;
          }
      }
      public abstract double Value
      {
          get;
          set;
      }
  }//end Cost

  public class Materials : Cost
  {

      private string name;
      private string description;
      private double value;
      private DateTime orderDate;
      private DateTime realizationDate;
      private string orderNumber;

      public Materials()
          : base()
      {
      }

      public override double Value
      {
          get
          {
              return this.value;
          }
          set
          {
              this.value = value;
          }
      }


      public string OrderNumber
      {
          get
          {
              return this.orderNumber;
          }
          set
          {
              this.orderNumber = value;
          }
      }
  }//end Materials

public class PlannedOperation : Cost
  {

      private double hours;

      public PlannedOperation()
      {

      }

      public double Hours
      {
          get
          {
              return this.hours;
          }
          set
          {
              this.hours = value;
          }
      }

      public override double Value
      {
          get
          {
              return this.hours * this.m_OperationMachine.Operation.CC.SearchRate
                  (this.Task.AddDate.Year.ToString()).Value;
          }
          set
          {

          }
      }
  }//end PlannedOperation

AnswerRe: Search in List Pin
Jimmanuel22-May-09 3:29
Jimmanuel22-May-09 3:29 
GeneralRe: Search in List Pin
arturw8222-May-09 3:59
arturw8222-May-09 3:59 
GeneralRe: Search in List Pin
Jimmanuel22-May-09 4:15
Jimmanuel22-May-09 4:15 
AnswerRe: Search in List Pin
musefan22-May-09 3:33
musefan22-May-09 3:33 
GeneralRe: Search in List [modified] Pin
arturw8222-May-09 3:36
arturw8222-May-09 3:36 
GeneralRe: Search in List Pin
musefan22-May-09 3:45
musefan22-May-09 3:45 
GeneralRe: Search in List Pin
arturw8222-May-09 3:56
arturw8222-May-09 3:56 
GeneralRe: Search in List Pin
musefan22-May-09 4:35
musefan22-May-09 4:35 
AnswerMessage Removed Pin
22-May-09 6:03
professionalN_tro_P22-May-09 6:03 
GeneralMessage Removed Pin
22-May-09 6:14
professionalN_tro_P22-May-09 6:14 
GeneralRe: Search in List Pin
arturw8222-May-09 9:37
arturw8222-May-09 9:37 
QuestionInternet Explorer object using c#? Pin
svt gdwl22-May-09 3:18
svt gdwl22-May-09 3:18 
AnswerRe: Internet Explorer object using c#? Pin
musefan22-May-09 3:29
musefan22-May-09 3:29 
QuestionHow to read excel content as html? Pin
DJ24522-May-09 3:12
DJ24522-May-09 3:12 
AnswerRe: How to read excel content as html? Pin
EliottA22-May-09 3:26
EliottA22-May-09 3:26 
QuestionNeed Help in DatagridView Pin
Rahul DSG22-May-09 2:43
Rahul DSG22-May-09 2:43 
AnswerRe: Need Help in DatagridView Pin
Mycroft Holmes22-May-09 2:55
professionalMycroft Holmes22-May-09 2:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.