Example #1
0
File: ENUser.cs Project: rlm33/svn
        public List<ENUser> Filter(String where)
        {
            List<ENUser> ret = new List<ENUser>();

            cad = new CADUser();

            DataTable table = cad.SelectWhere(where);

            try
            {

                foreach (DataRow row in table.Rows)
                {
                    ENUser course = new ENUser();
                    course.FromRow(row);
                    ret.Add(course);

                }
                return ret;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
File: ENUser.cs Project: rlm33/svn
 public List<ENUser> ReadAll()
 {
     List<ENUser> ret = new List<ENUser>();
     cad = new CADUser();
     DataTable tabla = cad.SelectAll();
     foreach (DataRow rows in tabla.Rows)
     {
         ENUser nuevo = new ENUser();
         nuevo.FromRow(rows);
         ret.Add(nuevo);
     }
     return ret;
 }
Example #3
0
 public override int Save()
 {
     ENUser us = new ENUser();
     us.Account = this.Account;
     us.Password = this.Password;
     us.Save();
     this.idUser = us.Id;
     if (id == 0)
     {
         return this.id = cad.Insert(ToDataRow);
     }
     else
     {
         cad.Update(ToDataRow);
         return 0;
     }
 }
Example #4
0
File: ENUser.cs Project: rlm33/svn
        /// <summary>
        /// Busca el usuario en la base de datos y lo devuelve.
        /// </summary>
        /// <param name="id">Identificador del usuario a buscar.</param>
        /// <returns>ENUser del usuario encontrado en la base de datos.</returns>
        public ENUser Read(int id)
        {
            ENUser ret = new ENUser();

            List<object> param = new List<object>();
            param.Add((object)id);
            cad = new CADUser();
            ret.FromRow(cad.Select(param));
            return ret;
        }
Example #5
0
 public void UserConnectingAndReadingAll()
 {
     var actual = new List<ENUser>();
     var user = new ENUser();
     actual = user.ReadAll();
 }