예제 #1
0
 public Case()
 {
     DB           = new DBObject();
     Customer     = new Customer();
     PC           = new PC();
     Status       = new CaseStatus();
     CreationDate = DateTime.Now;
     Parts        = new ObservableCollection <Part>();
 }
예제 #2
0
        public Case(int ID)
        {
            DB = new DBObject();
            DataSet ds = new DataSet();

            ds           = DB.Query($"SELECT * FROM sager WHERE ID = {ID}");
            this.ID      = (int)ds.Tables[0].Rows[0][0];
            Customer     = new Customer((int)ds.Tables[0].Rows[0][1]);
            PC           = new PC((int)ds.Tables[0].Rows[0][2]);
            Description  = (string)ds.Tables[0].Rows[0][3];
            Status       = new CaseStatus((int)ds.Tables[0].Rows[0][4]);
            CreationDate = Convert.ToDateTime(ds.Tables[0].Rows[0][5]);
            Parts        = new ObservableCollection <Part>();
        }