Ejemplo n.º 1
0
        public static AdministratorAccountItem Get(entitiesEvolveCentral ctx, int itemid)
        {
            var item = new AdministratorAccountItem();

            try
            {
                item = (from i in ctx.AdministratorAccountItems where i.Id == itemid select i).FirstOrDefault();
            }
            catch (Exception ex)
            {
                ApplicationLog.Log(ctx, "DAL.AdministratorAccount.Get(entitiesEvolveCentral ctx, int itemid)", ex.Message);
                item = null;
            }

            return(item);
        }
Ejemplo n.º 2
0
        public static AdministratorAccountItem Login(entitiesEvolveCentral ctx, string email, string password)
        {
            var item = new AdministratorAccountItem();

            try
            {
                item = (from i in ctx.AdministratorAccountItems where i.Email == email && i.Password == password select i).FirstOrDefault();
            }
            catch (Exception ex)
            {
                ApplicationLog.Log(ctx, "DAL.AdministratorAccount.Login(entitiesEvolveCentral ctx, string email,string password)", ex.Message);
                item = null;
            }

            return(item);
        }
Ejemplo n.º 3
0
        public static bool Delete(entitiesEvolveCentral ctx, AdministratorAccountItem item)
        {
            bool retval = true;

            try
            {
                ctx.AdministratorAccountItems.Remove(item);
                ctx.SaveChanges();
            }
            catch (Exception ex)
            {
                ApplicationLog.Log(ctx, "DAL.AdministratorAccount.Delete(entitiesEvolveCentral ctx, AdministratorAccountItem item)", ex.Message);
                retval = false;
            }

            return(retval);
        }