Exemple #1
0
        public Client()
        {
            dh      = new Data_Access_Layer.DataHandler();
            loc     = new Location();
            clients = new List <Client>();

            foreach (DataRow item in dh.GetData(Cons.table1).Rows)
            {
                clients.Add(new Client(
                                item[Cons.table1Id].ToString(),
                                item[Cons.table1Col1].ToString(),
                                item[Cons.table1Col2].ToString(),
                                item[Cons.table1Col3].ToString(),
                                (bool)item[Cons.table1Col5] ? "Female" : "Male",
                                (DateTime)item[Cons.table1Col4],
                                item[Cons.table1Col6].ToString(),
                                item[Cons.table1Col7].ToString(),
                                string.Empty,
                                string.Empty,
                                string.Empty,
                                loc[(int)item[Cons.table1IdFk]].Country,
                                loc.City,
                                loc.Street
                                ));
            }
        }
Exemple #2
0
        public Staff()
        {
            dh    = new Data_Access_Layer.DataHandler();
            loc   = new Location();
            staff = new List <Staff>();
            job   = new Job();

            foreach (DataRow item in dh.GetData(Cons.table3).Rows)
            {
                staff.Add(new Staff(
                              (int)item[Cons.table3Id],
                              item[Cons.table3Col1].ToString(),
                              item[Cons.table3Col2].ToString(),
                              item[Cons.table3Col3].ToString(),
                              (bool)item[Cons.table3Col5] ? "Female" : "Male",
                              (DateTime)item[Cons.table3Col4],
                              item[Cons.table3Col6].ToString(),
                              item[Cons.table3Col7].ToString(),
                              job[(int)item[Cons.table3IdFk1]].JobDesc,
                              loc[(int)item[Cons.table3IdFk2]].Country,
                              loc.City,
                              loc.Street
                              ));
            }
        }
Exemple #3
0
 public Staff Login(string username, string password)
 {
     dh = new Data_Access_Layer.DataHandler();
     foreach (DataRow item in dh.GetData(Cons.table10).Rows)
     {
         if (username.Equals(item[Cons.table10Col1].ToString()) && password.Equals(item[Cons.table10Col2].ToString()))
         {
             return(new Staff(username, password)[(int?)item[Cons.table10IDFk], item[Cons.table10Col3].ToString()]);
         }
     }
     return(null);
 }
Exemple #4
0
        public Job()
        {
            dh   = new Data_Access_Layer.DataHandler();
            jobs = new List <Job>();

            foreach (DataRow item in dh.GetData(Cons.table9).Rows)
            {
                jobs.Add(new Job(
                             (int)item[Cons.table9Id],
                             item[Cons.table9Col1].ToString(),
                             (decimal)item[Cons.table9Col2],
                             (DateTime)item[Cons.table9Col3],
                             item[Cons.table9Col4].ToString()));
            }
        }
Exemple #5
0
        public Location()
        {
            dh   = new Data_Access_Layer.DataHandler();
            locs = new List <Location>();
            foreach (DataRow item in dh.GetData(Cons.table4).Rows)
            {
                locs.Add(new Location(
                             (int)item[Cons.table4Id],
                             item[Cons.table4Col1].ToString().Trim(),
                             dh.Search(item[Cons.table4IdFk].ToString(), Cons.table5)[Cons.table5Col1].ToString(),
                             dh.Search(dh.Search(item[Cons.table4IdFk].ToString(),
                                                 Cons.table5)[Cons.table5IdFk].ToString(),
                                       Cons.table6)[Cons.table6Col1].ToString()

                             ));
            }
        }