예제 #1
0
        public List <Entity.UserType> GetAll()
        {
            string        query  = "SELECT UserTypeId, UserTypeName FROM UserType";
            SqlDataReader reader = DataAccess.GetData(query);

            Entity.UserType        userType     = null;
            List <Entity.UserType> userTypeList = new List <Entity.UserType>();

            while (reader.Read())
            {
                userType = new Entity.UserType(reader["UserTypeId"].ToString());
                userType.UserTypeName = reader["UserTypeName"].ToString();

                userTypeList.Add(userType);
            }
            return(userTypeList);
        }
예제 #2
0
        public int Edit(Entity.UserType userType)
        {
            string query = "UPDATE Account SET UserTypeName='" + userType.UserTypeName + "' WHERE UserTypeId=" + userType.UserTypeId;

            return(DataAccess.ExecuteQuery(query));
        }
예제 #3
0
        public int Add(Entity.UserType userType)
        {
            string query = string.Format("INSERT INTO UserType(UserTypeId, UserTypeName) VALUES('{0}', '{1}')", userType.UserTypeId, userType.UserTypeName);

            return(DataAccess.ExecuteQuery(query));
        }
 public int Edit(Entity.UserType userType)
 {
     return(UserTypeService.userTypeDataAccess.Edit(userType));
 }
 public int Add(Entity.UserType userType)
 {
     return(UserTypeService.userTypeDataAccess.Add(userType));
 }
 public void Update(Entity.UserType UserType)
 {
     _context.Entry(UserType).State = EntityState.Modified;
 }
 public void Insert(Entity.UserType UserType)
 {
     _context.Entry(UserType).State = EntityState.Added;
 }